diff options
| author | Camillo Lugaresi | 2012-06-08 05:44:11 +0200 |
|---|---|---|
| committer | Jack Nagel | 2012-07-01 12:20:47 -0500 |
| commit | 89f86dc283a2a77fa8bf3970c8dd0bf63f94529d (patch) | |
| tree | acdc46dabc37a2d00b6396f32052b3540f173443 /Library/Homebrew/cmd/--config.rb | |
| parent | 4488c3546d8020d6d343848239aecc107e456f03 (diff) | |
| download | brew-89f86dc283a2a77fa8bf3970c8dd0bf63f94529d.tar.bz2 | |
Better describe X11 in brew --config
Diffstat (limited to 'Library/Homebrew/cmd/--config.rb')
| -rw-r--r-- | Library/Homebrew/cmd/--config.rb | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/Library/Homebrew/cmd/--config.rb b/Library/Homebrew/cmd/--config.rb index 3cd7cf5e5..57dfd3560 100644 --- a/Library/Homebrew/cmd/--config.rb +++ b/Library/Homebrew/cmd/--config.rb @@ -52,44 +52,27 @@ module Homebrew extend self if sha.empty? then "(none)" else sha end end + def describe_path path + return "N/A" if path.nil? + realpath = path.realpath + if realpath == path then path else "#{path} => #{realpath}" end + end + def describe_x11 - return "N/A" unless x11_installed? - return case x11_path = Pathname.new("/usr/X11").realpath.to_s - when "/usr/X11" then "/usr/X11" - else "/usr/X11 => #{x11_path}" - end + return "N/A" unless MacOS.x11_installed? + return "#{MacOS.xquartz_version} @ " + describe_path(MacOS.x11_prefix) end def describe_perl - perl = which 'perl' - return "N/A" if perl.nil? - - real_perl = Pathname.new(perl).realpath - return perl if perl == real_perl - return "#{perl} => #{real_perl}" + describe_path(which 'perl') end def describe_python - python = which 'python' - return "N/A" if python.nil? - - real_python = Pathname.new(python).realpath - - return python if python == real_python - return "#{python} => #{real_python}" + describe_path(which 'python') end def describe_ruby - ruby = which 'ruby' - return "N/A" if ruby.nil? - - real_ruby = Pathname.new(ruby).realpath - return ruby if ruby == real_ruby - return "#{ruby} => #{real_ruby}" - end - - def real_path a_path - Pathname.new(a_path).realpath.to_s + describe_path(which 'ruby') end def hardware |
