diff options
author | Benoit Daloze <eregontp@gmail.com> | 2020-08-29 11:53:05 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2020-08-29 12:05:48 +0200 |
commit | fa21985a7a2f8f52a8bd82bd12a724e9dca74934 (patch) | |
tree | 903e98e41d494f36a10e022d8fefd04d8284414f | |
parent | a11b9ca01cef170d232c6b99bef86a52a9710df9 (diff) |
Sync with ruby/tempfile@aa9ea12d94a905161cbd79af1ad9ab427f250f4e
-rw-r--r-- | NEWS.md | 10 | ||||
-rw-r--r-- | lib/tempfile.rb | 2 |
2 files changed, 11 insertions, 1 deletions
@@ -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. diff --git a/lib/tempfile.rb b/lib/tempfile.rb index efb0b1bcd6..4148d30a86 100644 --- a/lib/tempfile.rb +++ b/lib/tempfile.rb @@ -290,7 +290,7 @@ class Tempfile < DelegateClass(File) begin yield(tempfile) ensure - tempfile.close + tempfile.close! end else tempfile |