aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/string.rb
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-24 17:38:49 +0200
committerGitHub2016-09-24 17:38:49 +0200
commite2c7509065d8cd6fd76cd631f5c8d1068df49cad (patch)
tree03eee4f10d15a33674735be36d0939da964ab60c /Library/Homebrew/extend/string.rb
parenteb3b94d94a7329d92171b75ea163f139cbf71aa6 (diff)
parent58e36c73193befb57d351344cea2a4a33fef850d (diff)
downloadbrew-e2c7509065d8cd6fd76cd631f5c8d1068df49cad.tar.bz2
Merge pull request #1113 from reitermarkus/rubocop-guardclause
RuboCop: Fix Style/GuardClause.
Diffstat (limited to 'Library/Homebrew/extend/string.rb')
-rw-r--r--Library/Homebrew/extend/string.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/Library/Homebrew/extend/string.rb b/Library/Homebrew/extend/string.rb
index bd5994fe1..162666d2d 100644
--- a/Library/Homebrew/extend/string.rb
+++ b/Library/Homebrew/extend/string.rb
@@ -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.