aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2012-02-02 19:10:15 -0800
committerAdam Vandenberg2012-02-02 19:10:56 -0800
commit8fe17772bb0c1de23a5b2c21d2aeb10c37793edf (patch)
treed241e8edb7a6c4e857878919309444ebefb0ad1c /Library
parent706da00b72fac9707aa8d0fa2eeddb3dffb3f88c (diff)
downloadbrew-8fe17772bb0c1de23a5b2c21d2aeb10c37793edf.tar.bz2
Show which Perl, Python and Ruby are in the path.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/--config.rb39
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