aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-12-31 09:50:21 -0500
committerJack Nagel2014-12-31 09:54:44 -0500
commit8ebaa9c0a9983ca5551263e808336a313bc234cd (patch)
tree20ff1a8a32ca8daefa5b31af267c8adb96037417
parent1de21b7f0003aa731ec3fc147237c9d5a19a41c4 (diff)
downloadbrew-8ebaa9c0a9983ca5551263e808336a313bc234cd.tar.bz2
Handle newer ruby versions correctly in config output
Since Ruby 2.1, patch releases take the form "2.x.y" rather than "2.x.y-pnum".
-rw-r--r--Library/Homebrew/cmd/config.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/config.rb b/Library/Homebrew/cmd/config.rb
index 9d8835e41..7d4d8cfc3 100644
--- a/Library/Homebrew/cmd/config.rb
+++ b/Library/Homebrew/cmd/config.rb
@@ -94,6 +94,21 @@ module Homebrew
@ponk.join(", ") unless @ponk.empty?
end
+ def describe_system_ruby
+ s = ""
+ case RUBY_VERSION
+ when /^1\.[89]/, /^2\.0/
+ s << "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
+ else
+ s << RUBY_VERSION
+ end
+
+ if RUBY_PATH.to_s !~ %r[^/System/Library/Frameworks/Ruby.framework/Versions/[12]\.[089]/usr/bin/ruby]
+ s << " => #{RUBY_PATH}"
+ end
+ s
+ end
+
def dump_verbose_config(f=$stdout)
f.puts "HOMEBREW_VERSION: #{HOMEBREW_VERSION}"
f.puts "ORIGIN: #{origin}"
@@ -111,7 +126,7 @@ module Homebrew
f.puts "Clang: #{clang ? "#{clang} build #{clang_build}" : "N/A"}"
f.puts "MacPorts/Fink: #{macports_or_fink}" if macports_or_fink
f.puts "X11: #{describe_x11}"
- f.puts "System Ruby: #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}"
+ f.puts "System Ruby: #{describe_system_ruby}"
f.puts "Perl: #{describe_perl}"
f.puts "Python: #{describe_python}"
f.puts "Ruby: #{describe_ruby}"