diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-04-08 18:28:34 +0900 |
---|---|---|
committer | git <[email protected]> | 2024-12-16 10:13:45 +0000 |
commit | 0769a48a215d40d3c52876d1377ceefe50db3afe (patch) | |
tree | 6c5b2742c75d5f46ae671fb5926b369ac77fff03 /lib/tmpdir.rb | |
parent | bf0f3239071a9fa11dc1b9553106eb37c89f384c (diff) |
[ruby/tmpdir] Tell if the block is given by block argument
https://github.com/ruby/tmpdir/commit/6e97a96d3b
Diffstat (limited to 'lib/tmpdir.rb')
-rw-r--r-- | lib/tmpdir.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/tmpdir.rb b/lib/tmpdir.rb index 967a011cf3..604051a488 100644 --- a/lib/tmpdir.rb +++ b/lib/tmpdir.rb @@ -98,13 +98,13 @@ class Dir # FileUtils.remove_entry dir # end # - def self.mktmpdir(prefix_suffix=nil, *rest, **options) + def self.mktmpdir(prefix_suffix=nil, *rest, **options, &block) base = nil path = Tmpname.create(prefix_suffix || "d", *rest, **options) {|path, _, _, d| base = d mkdir(path, 0700) } - if block_given? + if block begin yield path.dup ensure |