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
|
alias old_mkdir mkdir
|
||||||
|
|
||||||
# A version of mkdir that also changes to that folder in a block.
|
# A version of mkdir that also changes to that folder in a block.
|
||||||
def mkdir(name, &_block)
|
def mkdir(name, mode: nil, noop: nil, verbose: nil, &_block)
|
||||||
mkdir_p(name)
|
result = mkdir_p(name, mode: mode, noop: noop, verbose: verbose)
|
||||||
return unless block_given?
|
return result unless block_given?
|
||||||
chdir name do
|
chdir name do
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user