describe_homebrew_ruby: fix regex

`.` need to be escaped, otherwise it will match any character.

Also improve code style for handling string s.
This commit is contained in:
Xu Cheng 2016-07-13 15:34:49 +08:00
parent 99e9a22b85
commit b586a04204
No known key found for this signature in database
GPG Key ID: C2A3860FA0B459CE

View File

@ -31,10 +31,11 @@ class SystemConfig
def describe_homebrew_ruby def describe_homebrew_ruby
s = describe_homebrew_ruby_version s = describe_homebrew_ruby_version
if RUBY_PATH.to_s !~ %r{^/System/Library/Frameworks/Ruby.framework/Versions/[12]\.[089]/usr/bin/ruby} if RUBY_PATH.to_s !~ %r{^/System/Library/Frameworks/Ruby\.framework/Versions/[12]\.[089]/usr/bin/ruby}
s = "#{s} => #{RUBY_PATH}" "#{s} => #{RUBY_PATH}"
else
s
end end
s
end end
def dump_verbose_config(f = $stdout) def dump_verbose_config(f = $stdout)