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

ruby-changes:28347

From: akr <ko1@a...>
Date: Sun, 21 Apr 2013 00:16:33 +0900 (JST)
Subject: [ruby-changes:28347] akr:r40399 (trunk): * lib/tempfile.rb (Tempfile.create): Close when the block exits.

akr	2013-04-21 00:16:24 +0900 (Sun, 21 Apr 2013)

  New Revision: 40399

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

  Log:
    * lib/tempfile.rb (Tempfile.create): Close when the block exits.

  Modified files:
    trunk/ChangeLog
    trunk/lib/tempfile.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40398)
+++ ChangeLog	(revision 40399)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Apr 21 00:15:36 2013  Tanaka Akira  <akr@f...>
+
+	* lib/tempfile.rb (Tempfile.create): Close when the block exits.
+
 Sat Apr 20 23:38:14 2013  Tanaka Akira  <akr@f...>
 
 	* lib/webrick/httpauth/htpasswd.rb: Use Tempfile.create to avoid
Index: lib/tempfile.rb
===================================================================
--- lib/tempfile.rb	(revision 40398)
+++ lib/tempfile.rb	(revision 40399)
@@ -370,6 +370,7 @@ def Tempfile.create(basename, *rest) https://github.com/ruby/ruby/blob/trunk/lib/tempfile.rb#L370
     begin
       yield tmpfile
     ensure
+      tmpfile.close if !tmpfile.closed?
       File.unlink tmpfile
     end
   else

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

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