extend/fileutils: fix monkeypatch.
Otherwise using the options argument or relying on a result means this method will fail. This is why monkeypatching sucks. CC @reitermarkus as we've talked about monkeypatching recently.
This commit is contained in:
parent
e1eb7dd3e3
commit
c3f8ffbb10
@ -86,9 +86,9 @@ module FileUtils
|
||||
alias old_mkdir mkdir
|
||||
|
||||
# A version of mkdir that also changes to that folder in a block.
|
||||
def mkdir(name, &_block)
|
||||
mkdir_p(name)
|
||||
return unless block_given?
|
||||
def mkdir(name, mode: nil, noop: nil, verbose: nil, &_block)
|
||||
result = mkdir_p(name, mode: mode, noop: noop, verbose: verbose)
|
||||
return result unless block_given?
|
||||
chdir name do
|
||||
yield
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user