Allow inreplace to operate over arrays
I like that String.each is interchangeable with Array.each :)
This commit is contained in:
parent
0d73cbbc53
commit
b48d46d4bc
@ -195,6 +195,7 @@ module HomebrewInreplaceExtension
|
||||
end
|
||||
|
||||
def inreplace path, before=nil, after=nil
|
||||
path.each do |path|
|
||||
f = File.open(path, 'r')
|
||||
s = f.read
|
||||
|
||||
@ -208,6 +209,7 @@ def inreplace path, before=nil, after=nil
|
||||
f.reopen(path, 'w').write(s)
|
||||
f.close
|
||||
end
|
||||
end
|
||||
|
||||
def ignore_interrupts
|
||||
std_trap = trap("INT") {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user