[前][次][番号順一覧][スレッド一覧]

ruby-changes:34108

From: akr <ko1@a...>
Date: Wed, 28 May 2014 00:49:24 +0900 (JST)
Subject: [ruby-changes:34108] akr:r46189 (trunk): * test/lib/minitest/unit.rb: Use Tempfile#close! instead of

akr	2014-05-28 00:49:13 +0900 (Wed, 28 May 2014)

  New Revision: 46189

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=46189

  Log:
    * test/lib/minitest/unit.rb: Use Tempfile#close! instead of
      Tempfile#unlink to close file descriptors.
    
    * test/openssl/test_config.rb: Ditto.
    
    * test/ruby/test_io.rb: Ditto.

  Modified files:
    trunk/ChangeLog
    trunk/lib/cgi/core.rb
    trunk/test/lib/minitest/unit.rb
    trunk/test/openssl/test_config.rb
    trunk/test/ruby/test_io.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46188)
+++ ChangeLog	(revision 46189)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed May 28 00:38:09 2014  Tanaka Akira  <akr@f...>
+
+	* test/lib/minitest/unit.rb: Use Tempfile#close! instead of
+	  Tempfile#unlink to close file descriptors.
+
+	* test/openssl/test_config.rb: Ditto.
+
+	* test/ruby/test_io.rb: Ditto.
+
 Wed May 28 00:06:18 2014  Tanaka Akira  <akr@f...>
 
 	* lib/net/ftp.rb (transfercmd): Close TCP server socket even if an
@@ -5,7 +14,7 @@ Wed May 28 00:06:18 2014  Tanaka Akira https://github.com/ruby/ruby/blob/trunk/ChangeLog#L14
 
 Tue May 27 23:50:07 2014  Tanaka Akira  <akr@f...>
 
-	* lib/cgi/core.rb: Use Tempfile#close(true) instead of Tempfile#unlink
+	* lib/cgi/core.rb: Use Tempfile#close! instead of Tempfile#unlink
 	  to close file descriptors.
 
 Tue May 27 23:06:46 2014  Nobuyoshi Nakada  <nobu@r...>
Index: lib/cgi/core.rb
===================================================================
--- lib/cgi/core.rb	(revision 46188)
+++ lib/cgi/core.rb	(revision 46189)
@@ -550,7 +550,7 @@ class CGI https://github.com/ruby/ruby/blob/trunk/lib/cgi/core.rb#L550
         name = $1 || $2 || ''
         if body.original_filename.empty?
           value=body.read.dup.force_encoding(@accept_charset)
-          body.close(true) if defined?(Tempfile) && body.kind_of?(Tempfile)
+          body.close! if defined?(Tempfile) && body.kind_of?(Tempfile)
           (params[name] ||= []) << value
           unless value.valid_encoding?
             if @accept_charset_error_block
@@ -578,7 +578,7 @@ class CGI https://github.com/ruby/ruby/blob/trunk/lib/cgi/core.rb#L578
       if tempfiles
         tempfiles.each {|t|
           if t.path
-            t.close(true)
+            t.close!
           end
         }
       end
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 46188)
+++ test/ruby/test_io.rb	(revision 46189)
@@ -1924,7 +1924,7 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L1924
       assert_raise(Errno::EBADF, feature2250) {t.close}
     end
   ensure
-    t.unlink
+    t.close!
   end
 
   def test_autoclose_false_closed_by_finalizer
@@ -1940,7 +1940,7 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L1940
       assert_nothing_raised(Errno::EBADF, feature2250) {t.close}
     end
   ensure
-    t.unlink
+    t.close!
   end
 
   def test_open_redirect
@@ -2366,7 +2366,7 @@ End https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2366
     }
   ensure
     GC.start
-    t.unlink
+    t.close!
   end
 
   def test_flush_in_finalizer2
@@ -2382,7 +2382,7 @@ End https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2382
       assert_nothing_raised(TypeError, bug3910) do
         GC.start
       end
-      t.unlink
+      t.close!
     }
   end
 
Index: test/openssl/test_config.rb
===================================================================
--- test/openssl/test_config.rb	(revision 46188)
+++ test/openssl/test_config.rb	(revision 46189)
@@ -17,7 +17,7 @@ __EOD__ https://github.com/ruby/ruby/blob/trunk/test/openssl/test_config.rb#L17
   end
 
   def teardown
-    @tmpfile.unlink
+    @tmpfile.close!
   end
 
   def test_constants
Index: test/lib/minitest/unit.rb
===================================================================
--- test/lib/minitest/unit.rb	(revision 46188)
+++ test/lib/minitest/unit.rb	(revision 46189)
@@ -1063,7 +1063,7 @@ module MiniTest https://github.com/ruby/ruby/blob/trunk/test/lib/minitest/unit.rb#L1063
         list.each {|str|
           puts "Leaked tempfile: #{name}: #{str}"
         }
-        tempfile_retained.each {|t| t.unlink }
+        tempfile_retained.each {|t| t.close! }
       end
       live2
     end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]