aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils
diff options
context:
space:
mode:
authorJack Nagel2014-03-26 16:07:49 -0500
committerJack Nagel2014-03-26 16:07:49 -0500
commit670128354dcae2ce7405c4c106cceb5585973dc9 (patch)
tree65d211db8b10ac8b6019b72b7016789fbffb39f4 /Library/Homebrew/utils
parent41c21e6ea5647823a9e589a56f0494b622e26fb2 (diff)
downloadhomebrew-670128354dcae2ce7405c4c106cceb5585973dc9.tar.bz2
Drop intermediate variable
Diffstat (limited to 'Library/Homebrew/utils')
-rw-r--r--Library/Homebrew/utils/inreplace.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb
index 287058021..4fa2fbe7c 100644
--- a/Library/Homebrew/utils/inreplace.rb
+++ b/Library/Homebrew/utils/inreplace.rb
@@ -10,8 +10,7 @@ module Utils
yield s
else
after = after.to_s if Symbol === after
- sub = s.gsub!(before, after)
- if sub.nil?
+ unless s.gsub!(before, after)
message = <<-EOS.undent
inreplace in '#{path}' failed
Expected replacement of '#{before}' with '#{after}'