Skip to content

Commit 6e97a96

Browse files
committed
Tell if the block is given by block argument
1 parent a8ceafa commit 6e97a96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/tmpdir.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ def self.tmpdir
9898
# FileUtils.remove_entry dir
9999
# end
100100
#
101-
def self.mktmpdir(prefix_suffix=nil, *rest, **options)
101+
def self.mktmpdir(prefix_suffix=nil, *rest, **options, &block)
102102
base = nil
103103
path = Tmpname.create(prefix_suffix || "d", *rest, **options) {|path, _, _, d|
104104
base = d
105105
mkdir(path, 0700)
106106
}
107-
if block_given?
107+
if block
108108
begin
109109
yield path.dup
110110
ensure

0 commit comments

Comments
 (0)