diff options
| author | Markus Reiter | 2017-01-26 08:54:52 +0100 |
|---|---|---|
| committer | Markus Reiter | 2017-02-05 06:48:23 +0100 |
| commit | f0337a318320bebe56de1b07b406cd8fbca9c8a5 (patch) | |
| tree | d705096d50ebae327fd1a4c9ceb71479edaa5c84 | |
| parent | 7d312e4ccadd1852b0ae956e19248eea7ec13696 (diff) | |
| download | brew-f0337a318320bebe56de1b07b406cd8fbca9c8a5.tar.bz2 | |
Simplify output of environment variables.
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/doctor.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb index cba3ba0e6..0fa08be8a 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb @@ -10,21 +10,22 @@ module Hbc puts render_taps(Hbc.default_tap) puts render_taps(*alt_taps) ohai "Contents of $LOAD_PATH:", render_load_path($LOAD_PATH) - ohai "Contents of $RUBYLIB Environment Variable:", render_env_var("RUBYLIB") - ohai "Contents of $RUBYOPT Environment Variable:", render_env_var("RUBYOPT") - ohai "Contents of $RUBYPATH Environment Variable:", render_env_var("RUBYPATH") - ohai "Contents of $RBENV_VERSION Environment Variable:", render_env_var("RBENV_VERSION") - ohai "Contents of $CHRUBY_VERSION Environment Variable:", render_env_var("CHRUBY_VERSION") - ohai "Contents of $GEM_HOME Environment Variable:", render_env_var("GEM_HOME") - ohai "Contents of $GEM_PATH Environment Variable:", render_env_var("GEM_PATH") - ohai "Contents of $BUNDLE_PATH Environment Variable:", render_env_var("BUNDLE_PATH") - ohai "Contents of $PATH Environment Variable:", render_env_var("PATH") - ohai "Contents of $SHELL Environment Variable:", render_env_var("SHELL") - ohai "Contents of Locale Environment Variables:", render_with_none(locale_variables) + ohai "Environment Variables:" + render_env_var("RUBYLIB") + render_env_var("RUBYOPT") + render_env_var("RUBYPATH") + render_env_var("RBENV_VERSION") + render_env_var("CHRUBY_VERSION") + render_env_var("GEM_HOME") + render_env_var("GEM_PATH") + render_env_var("BUNDLE_PATH") + render_env_var("PATH") + render_env_var("SHELL") + locale_variables end def self.locale_variables - ENV.keys.grep(/^(?:LC_\S+|LANG|LANGUAGE)\Z/).collect { |v| %Q(#{v}="#{ENV[v]}") }.sort.join("\n") + ENV.keys.grep(/^(?:LC_\S+|LANG|LANGUAGE)\Z/).sort.each(&method(:render_env_var)) end def self.none_string @@ -63,9 +64,8 @@ module Hbc def self.render_env_var(var) if ENV.key?(var) - %Q(#{var}="#{ENV[var]}") - else - none_string + var = %Q(#{var}="#{ENV[var]}") + puts var.gsub(ENV["HOME"], "~") end end |
