ruby-changes:66320
From: Hiroshi <ko1@a...>
Date: Thu, 27 May 2021 14:42:36 +0900 (JST)
Subject: [ruby-changes:66320] e49c998d1e (master): Promote net-ftp to the bundled gems
https://git.ruby-lang.org/ruby.git/commit/?id=e49c998d1e From e49c998d1e41737016c8afb7e1b22797018caebb Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Wed, 26 May 2021 15:44:27 +0900 Subject: Promote net-ftp to the bundled gems --- doc/maintainers.rdoc | 6 +- doc/standard_library.rdoc | 2 +- gems/bundled_gems | 1 + lib/net/ftp.rb | 1544 -------------------- lib/net/net-ftp.gemspec | 36 - misc/expand_tabs.rb | 1 - test/net/ftp/test_buffered_socket.rb | 48 - test/net/ftp/test_ftp.rb | 2636 ---------------------------------- test/net/ftp/test_mlsx_entry.rb | 98 -- tool/sync_default_gems.rb | 6 - 10 files changed, 4 insertions(+), 4374 deletions(-) delete mode 100644 lib/net/ftp.rb delete mode 100644 lib/net/net-ftp.gemspec delete mode 100644 test/net/ftp/test_buffered_socket.rb delete mode 100644 test/net/ftp/test_ftp.rb delete mode 100644 test/net/ftp/test_mlsx_entry.rb diff --git a/doc/maintainers.rdoc b/doc/maintainers.rdoc index 79c30b8..965e9e8 100644 --- a/doc/maintainers.rdoc +++ b/doc/maintainers.rdoc @@ -154,10 +154,6 @@ Yukihiro Matsumoto (matz) https://github.com/ruby/ruby/blob/trunk/doc/maintainers.rdoc#L154 Keiju ISHITSUKA (keiju) https://github.com/ruby/mutex_m https://rubygems.org/gems/mutex_m -[lib/net/ftp.rb] - Shugo Maeda (shugo) - https://github.com/ruby/net-ftp - https://rubygems.org/gems/net-ftp [lib/net/http.rb, lib/net/https.rb] NARUSE, Yui (naruse) https://github.com/ruby/net-http @@ -391,6 +387,8 @@ Yukihiro Matsumoto (matz) https://github.com/ruby/ruby/blob/trunk/doc/maintainers.rdoc#L387 https://github.com/ruby/rexml [rss] https://github.com/ruby/rss +[net-ftp] + https://github.com/ruby/net-ftp [matrix] https://github.com/ruby/matrix [prime] diff --git a/doc/standard_library.rdoc b/doc/standard_library.rdoc index e05eb6f..2c23c10 100644 --- a/doc/standard_library.rdoc +++ b/doc/standard_library.rdoc @@ -46,7 +46,6 @@ IRB:: Interactive Ruby command-line tool for REPL (Read Eval Print Loop) https://github.com/ruby/ruby/blob/trunk/doc/standard_library.rdoc#L46 OptionParser:: Ruby-oriented class for command-line option analysis Logger:: Provides a simple logging utility for outputting messages Mutex_m:: Mixin to extend objects to be handled like a Mutex -Net::FTP:: Support for the File Transfer Protocol Net::HTTP:: HTTP client api for Ruby Net::IMAP:: Ruby client api for Internet Message Access Protocol Net::POP3:: Ruby client library for POP3 @@ -109,6 +108,7 @@ Rake:: Ruby build program with capabilities similar to make https://github.com/ruby/ruby/blob/trunk/doc/standard_library.rdoc#L108 Test::Unit:: A compatibility layer for MiniTest REXML:: An XML toolkit for Ruby RSS:: Family of libraries that support various formats of XML "feeds" +Net::FTP:: Support for the File Transfer Protocol Matrix:: Represents a mathematical matrix. Prime:: Prime numbers and factorization library RBS:: RBS is a language to describe the structure of Ruby programs diff --git a/gems/bundled_gems b/gems/bundled_gems index b42c679..e944d21 100644 --- a/gems/bundled_gems +++ b/gems/bundled_gems @@ -5,6 +5,7 @@ rake 13.0.3 https://github.com/ruby/rake https://github.com/ruby/ruby/blob/trunk/gems/bundled_gems#L5 test-unit 3.4.1 https://github.com/test-unit/test-unit 3.4.1 rexml 3.2.5 https://github.com/ruby/rexml rss 0.2.9 https://github.com/ruby/rss 0.2.9 +net-ftp 0.1.2 https://github.com/ruby/net-ftp matrix 0.4.1 https://github.com/ruby/matrix prime 0.1.2 https://github.com/ruby/prime typeprof 0.14.1 https://github.com/ruby/typeprof diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb deleted file mode 100644 index 68d5375..0000000 --- a/lib/net/ftp.rb +++ /dev/null @@ -1,1544 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/gems/bundled_gems#L0 -# frozen_string_literal: true -# -# = net/ftp.rb - FTP Client Library -# -# Written by Shugo Maeda <shugo@r...>. -# -# Documentation by Gavin Sinclair, sourced from "Programming Ruby" (Hunt/Thomas) -# and "Ruby In a Nutshell" (Matsumoto), used with permission. -# -# This library is distributed under the terms of the Ruby license. -# You can freely distribute/modify this library. -# -# It is included in the Ruby standard library. -# -# See the Net::FTP class for an overview. -# - -require "socket" -require "monitor" -require "net/protocol" -require "time" -begin - require "openssl" -rescue LoadError -end - -module Net - - # :stopdoc: - class FTPError < StandardError; end - class FTPReplyError < FTPError; end - class FTPTempError < FTPError; end - class FTPPermError < FTPError; end - class FTPProtoError < FTPError; end - class FTPConnectionError < FTPError; end - # :startdoc: - - # - # This class implements the File Transfer Protocol. If you have used a - # command-line FTP program, and are familiar with the commands, you will be - # able to use this class easily. Some extra features are included to take - # advantage of Ruby's style and strengths. - # - # == Example - # - # require 'net/ftp' - # - # === Example 1 - # - # ftp = Net::FTP.new('example.com') - # ftp.login - # files = ftp.chdir('pub/lang/ruby/contrib') - # files = ftp.list('n*') - # ftp.getbinaryfile('nif.rb-0.91.gz', 'nif.gz', 1024) - # ftp.close - # - # === Example 2 - # - # Net::FTP.open('example.com') do |ftp| - # ftp.login - # files = ftp.chdir('pub/lang/ruby/contrib') - # files = ftp.list('n*') - # ftp.getbinaryfile('nif.rb-0.91.gz', 'nif.gz', 1024) - # end - # - # == Major Methods - # - # The following are the methods most likely to be useful to users: - # - FTP.open - # - #getbinaryfile - # - #gettextfile - # - #putbinaryfile - # - #puttextfile - # - #chdir - # - #nlst - # - #size - # - #rename - # - #delete - # - class FTP < Protocol - include MonitorMixin - if defined?(OpenSSL::SSL) - include OpenSSL - include SSL - end - - # :stopdoc: - VERSION = "0.1.2" - FTP_PORT = 21 - CRLF = "\r\n" - DEFAULT_BLOCKSIZE = BufferedIO::BUFSIZE - @@default_passive = true - # :startdoc: - - # When +true+, transfers are performed in binary mode. Default: +true+. - attr_reader :binary - - # When +true+, the connection is in passive mode. Default: +true+. - attr_accessor :passive - - # When +true+, all traffic to and from the server is written - # to +$stdout+. Default: +false+. - attr_accessor :debug_mode - - # Sets or retrieves the +resume+ status, which decides whether incomplete - # transfers are resumed or restarted. Default: +false+. - attr_accessor :resume - - # Number of seconds to wait for the connection to open. Any number - # may be used, including Floats for fractional seconds. If the FTP - # object cannot open a connection in this many seconds, it raises a - # Net::OpenTimeout exception. The default value is +nil+. - attr_accessor :open_timeout - - # Number of seconds to wait for the TLS handshake. Any number - # may be used, including Floats for fractional seconds. If the FTP - # object cannot complete the TLS handshake in this many seconds, it - # raises a Net::OpenTimeout exception. The default value is +nil+. - # If +ssl_handshake_timeout+ is +nil+, +open_timeout+ is used instead. - attr_accessor :ssl_handshake_timeout - - # Number of seconds to wait for one block to be read (via one read(2) - # call). Any number may be used, including Floats for fractional - # seconds. If the FTP object cannot read data in this many seconds, - # it raises a Timeout::Error exception. The default value is 60 seconds. - attr_reader :read_timeout - - # Setter for the read_timeout attribute. - def read_timeout=(sec) - @sock.read_timeout = sec - @read_timeout = sec - end - - # The server's welcome message. - attr_reader :welcome - - # The server's last response code. - attr_reader :last_response_code - alias lastresp last_response_code - - # The server's last response. - attr_reader :last_response - - # When +true+, connections are in passive mode per default. - # Default: +true+. - def self.default_passive=(value) - @@default_passive = value - end - - # When +true+, connections are in passive mode per default. - # Default: +true+. - def self.default_passive - @@default_passive - end - - # - # A synonym for <tt>FTP.new</tt>, but with a mandatory host parameter. - # - # If a block is given, it is passed the +FTP+ object, which will be closed - # when the block finishes, or when an exception is raised. - # - def FTP.open(host, *args) - if block_given? - ftp = new(host, *args) - begin - yield ftp - ensure - ftp.close - end - else - new(host, *args) - end - end - - # :call-seq: - # Net::FTP.new(host = nil, options = {}) - # - # Creates and returns a new +FTP+ object. If a +host+ is given, a connection - # is made. - # - # +options+ is an option hash, each key of which is a symbol. - # - # The available options are: - # - # port:: Port number (default value is 21) - # ssl:: If +options+[:ssl] is true, then an attempt will be made - # to use SSL (now TLS) to connect to the server. For this - # to work OpenSSL [OSSL] and the Ruby OpenSSL [RSSL] - # extensions need to be installed. If +options+[:ssl] is a - # hash, it's passed to OpenSSL::SSL::SSLContext#set_params - # as parameters. - # private_data_connection:: If true, TLS is used for data connections. - # Default: +true+ when +options+[:ssl] is true. - # username:: Username for login. If +options+[:username] is the string - # "anonymous" and the +options (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/