mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/tempfile.rb (Tempfile.create): Close when the block exits.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
45e02258c0
commit
65261bda4d
2 changed files with 5 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
Sun Apr 21 00:15:36 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* lib/tempfile.rb (Tempfile.create): Close when the block exits.
|
||||
|
||||
Sat Apr 20 23:38:14 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* lib/webrick/httpauth/htpasswd.rb: Use Tempfile.create to avoid
|
||||
|
|
|
@ -370,6 +370,7 @@ def Tempfile.create(basename, *rest)
|
|||
begin
|
||||
yield tmpfile
|
||||
ensure
|
||||
tmpfile.close if !tmpfile.closed?
|
||||
File.unlink tmpfile
|
||||
end
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue