1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-08-29 11:53:05 +02:00
parent a11b9ca01c
commit fa21985a7a
2 changed files with 11 additions and 1 deletions

10
NEWS.md
View file

@ -191,6 +191,16 @@ Outstanding ones only.
take request headers as a Hash in the second argument when the first
argument is a URI. [[Feature #16686]]
* Tempfile
* Modified method
* `Tempfile.open { ... }` will now unlink the file at the end of the
block (https://github.com/ruby/tempfile/pull/3), such that once the
block finishes execution nothing leaks.
## Compatibility issues
Excluding feature bug fixes.

View file

@ -290,7 +290,7 @@ class Tempfile < DelegateClass(File)
begin
yield(tempfile)
ensure
tempfile.close
tempfile.close!
end
else
tempfile