diff options
| author | Jack Nagel | 2014-12-31 09:50:21 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-12-31 09:54:44 -0500 |
| commit | 00d80c3ebbf352ceaf1d71732b23a09a22ae5204 (patch) | |
| tree | e455b01b2e1644cb41b27bd656727278bd66da62 /Library | |
| parent | 46723975b59406e8dbf4c51bec7abd8dd440321b (diff) | |
| download | homebrew-00d80c3ebbf352ceaf1d71732b23a09a22ae5204.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".
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/config.rb | 17 |
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}" |
