diff options
| author | Adam Vandenberg | 2012-02-02 19:10:15 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2012-02-02 19:10:56 -0800 |
| commit | 590c0df6cab1ce6d8f5d8987ef7aaa532ed9829e (patch) | |
| tree | b3809dd923be40c3c82a1f4b7426d1fcba3efd78 /Library | |
| parent | 94f49a01a5363c29907a17d17b43fa34db4da5a9 (diff) | |
| download | homebrew-590c0df6cab1ce6d8f5d8987ef7aaa532ed9829e.tar.bz2 | |
Show which Perl, Python and Ruby are in the path.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/--config.rb | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/--config.rb b/Library/Homebrew/cmd/--config.rb index e39842c5e..db11a0d87 100644 --- a/Library/Homebrew/cmd/--config.rb +++ b/Library/Homebrew/cmd/--config.rb @@ -36,8 +36,36 @@ module Homebrew extend self if sha.empty? then "(none)" else sha end end - def system_ruby - Pathname.new('/usr/bin/ruby').realpath.to_s + def describe_perl + perl = `which perl`.chomp + return "N/A" unless perl + + real_perl = Pathname.new(perl).realpath.to_s + return perl if perl == real_perl + return "#{perl} => #{real_perl}" + end + + def describe_python + python = `which python`.chomp + return "N/A" unless python + + real_python = Pathname.new(python).realpath.to_s + + return python if python == real_python + return "#{python} => #{real_python}" + end + + def describe_ruby + ruby = `which ruby`.chomp + return "N/A" unless ruby + + real_ruby = Pathname.new(ruby).realpath.to_s + return ruby if ruby == real_ruby + return "#{ruby} => #{real_ruby}" + end + + def real_path a_path + Pathname.new(a_path).realpath.to_s end def config_s; <<-EOS.undent @@ -48,8 +76,6 @@ module Homebrew extend self Hardware: #{Hardware.cores_as_words}-core #{Hardware.bits}-bit #{Hardware.intel_family} OS X: #{MACOS_FULL_VERSION} Kernel Architecture: #{`uname -m`.chomp} - Ruby: #{RUBY_VERSION}-#{RUBY_PATCHLEVEL} - /usr/bin/ruby => #{system_ruby} Xcode: #{xcode_version} GCC-4.0: #{gcc_40 ? "build #{gcc_40}" : "N/A"} GCC-4.2: #{gcc_42 ? "build #{gcc_42}" : "N/A"} @@ -57,6 +83,11 @@ module Homebrew extend self Clang: #{clang ? "#{clang} build #{clang_build}" : "N/A"} MacPorts or Fink? #{macports_or_fink_installed?} X11 installed? #{x11_installed?} + System Ruby: #{RUBY_VERSION}-#{RUBY_PATCHLEVEL} + /usr/bin/ruby => #{real_path("/usr/bin/ruby")} + Which Perl: #{describe_perl} + Which Python: #{describe_python} + Which Ruby: #{describe_ruby} EOS end end |
