ruby-changes:42203
From: usa <ko1@a...>
Date: Fri, 25 Mar 2016 18:31:30 +0900 (JST)
Subject: [ruby-changes:42203] usa:r54277 (ruby_2_1): merge revision(s) 53810: [Backport #12044]
usa 2016-03-25 18:31:25 +0900 (Fri, 25 Mar 2016) New Revision: 54277 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54277 Log: merge revision(s) 53810: [Backport #12044] * net/ftp.rb: add NullSocket#closed? to fix closing not opened connection. [Fix GH-1232] Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/lib/net/ftp.rb branches/ruby_2_1/test/net/ftp/test_ftp.rb branches/ruby_2_1/version.h Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 54276) +++ ruby_2_1/ChangeLog (revision 54277) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Fri Mar 25 18:30:55 2016 Anthony Dmitriyev <antstorm@g...> + + * net/ftp.rb: add NullSocket#closed? to fix closing not opened + connection. [Fix GH-1232] + Fri Mar 25 18:26:40 2016 Nobuyoshi Nakada <nobu@r...> * numeric.c (num_step_scan_args): comparison String with Numeric Index: ruby_2_1/test/net/ftp/test_ftp.rb =================================================================== --- ruby_2_1/test/net/ftp/test_ftp.rb (revision 54276) +++ ruby_2_1/test/net/ftp/test_ftp.rb (revision 54277) @@ -23,6 +23,14 @@ class FTPTest < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/net/ftp/test_ftp.rb#L23 end end + def test_closed_when_not_connected + ftp = Net::FTP.new + assert_equal(true, ftp.closed?) + assert_nothing_raised(Net::FTPConnectionError) do + ftp.close + end + end + def test_connect_fail server = create_ftp_server { |sock| sock.print("421 Service not available, closing control connection.\r\n") Index: ruby_2_1/lib/net/ftp.rb =================================================================== --- ruby_2_1/lib/net/ftp.rb (revision 54276) +++ ruby_2_1/lib/net/ftp.rb (revision 54277) @@ -1070,6 +1070,10 @@ module Net https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/net/ftp.rb#L1070 def read_timeout=(sec) end + def closed? + true + end + def close end Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 54276) +++ ruby_2_1/version.h (revision 54277) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.9" #define RUBY_RELEASE_DATE "2016-03-25" -#define RUBY_PATCHLEVEL 474 +#define RUBY_PATCHLEVEL 475 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 3 Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r53810 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/