aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
authorXu Cheng2016-07-13 15:34:49 +0800
committerXu Cheng2016-07-13 15:34:49 +0800
commitb586a04204cbaa5e4e3986a3f274bc0c4201db91 (patch)
treee470e5661d2117ab9f4c9759a1dc9795f108fae6 /Library/Homebrew/extend
parent99e9a22b851c027f286247ad37fb81d468c201e7 (diff)
downloadbrew-b586a04204cbaa5e4e3986a3f274bc0c4201db91.tar.bz2
describe_homebrew_ruby: fix regex
`.` need to be escaped, otherwise it will match any character. Also improve code style for handling string s.
Diffstat (limited to 'Library/Homebrew/extend')
-rw-r--r--Library/Homebrew/extend/os/mac/system_config.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/Library/Homebrew/extend/os/mac/system_config.rb b/Library/Homebrew/extend/os/mac/system_config.rb
index d3b362aac..c369f38e6 100644
--- a/Library/Homebrew/extend/os/mac/system_config.rb
+++ b/Library/Homebrew/extend/os/mac/system_config.rb
@@ -31,10 +31,11 @@ class SystemConfig
def describe_homebrew_ruby
s = describe_homebrew_ruby_version
- if RUBY_PATH.to_s !~ %r{^/System/Library/Frameworks/Ruby.framework/Versions/[12]\.[089]/usr/bin/ruby}
- s = "#{s} => #{RUBY_PATH}"
+ if RUBY_PATH.to_s !~ %r{^/System/Library/Frameworks/Ruby\.framework/Versions/[12]\.[089]/usr/bin/ruby}
+ "#{s} => #{RUBY_PATH}"
+ else
+ s
end
- s
end
def dump_verbose_config(f = $stdout)