let inreplace take a symbol

As discussed in https://github.com/mxcl/homebrew/pull/21936

Closes Homebrew/homebrew#21942.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Jason Whittle 2013-08-16 19:50:52 -04:00 committed by Adam Vandenberg
parent ecb78d54c0
commit 2c23e71be3

View File

@ -9,6 +9,7 @@ module Utils
s.extend(StringInreplaceExtension)
yield s
else
after = after.to_s if Symbol === after
sub = s.gsub!(before, after)
if sub.nil?
opoo "inreplace in '#{path}' failed"