diff options
| author | Mike McQuaid | 2016-09-24 20:48:03 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-09-24 20:48:03 +0100 |
| commit | e767fd3df9d179fca0445cc0bc0fdc061ad857d6 (patch) | |
| tree | 93e9db33313b36eebe7d7fb3aedf0f92cc2c3918 /Library/Homebrew/extend/string.rb | |
| parent | 7fc241765e3654718235791c32e5638bf7f8e15a (diff) | |
| parent | 232078df57418004bb9bf7abef877e734fcf7005 (diff) | |
| download | brew-e767fd3df9d179fca0445cc0bc0fdc061ad857d6.tar.bz2 | |
Merge branch 'master' into mkdir_with_intermediates
Diffstat (limited to 'Library/Homebrew/extend/string.rb')
| -rw-r--r-- | Library/Homebrew/extend/string.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Library/Homebrew/extend/string.rb b/Library/Homebrew/extend/string.rb index 1d9c2e036..162666d2d 100644 --- a/Library/Homebrew/extend/string.rb +++ b/Library/Homebrew/extend/string.rb @@ -13,7 +13,7 @@ class String # sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt # mollit anim id est laborum. # EOS - alias_method :undent_________________________________________________________72, :undent + alias undent_________________________________________________________72 undent # String.chomp, but if result is empty: returns nil instead. # Allows `chuzzle || foo` short-circuits. @@ -59,9 +59,8 @@ module StringInreplaceExtension # Looks for Makefile style variable defintions and replaces the # value with "new_value", or removes the definition entirely. def change_make_var!(flag, new_value) - unless gsub!(/^#{Regexp.escape(flag)}[ \t]*=[ \t]*(.*)$/, "#{flag}=#{new_value}", false) - errors << "expected to change #{flag.inspect} to #{new_value.inspect}" - end + return if gsub!(/^#{Regexp.escape(flag)}[ \t]*=[ \t]*(.*)$/, "#{flag}=#{new_value}", false) + errors << "expected to change #{flag.inspect} to #{new_value.inspect}" end # Removes variable assignments completely. |
