diff --git a/Library/Homebrew/cmd/--config.rb b/Library/Homebrew/cmd/--config.rb index 3cd7cf5e5e..57dfd3560c 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