class Mysh::EnvInfoCommand

Get info on the mysh environment.

Public Instance Methods

process_command(_args) click to toggle source

Execute the @env shell command.

# File lib/mysh/show/env.rb, line 10
def process_command(_args)
  print WORKING
  Gem.refresh

  puts "Key mysh environment information.", "",
       info.format_output_bullets, "",
       path.format_output_bullets, ""
end

Private Instance Methods

info() click to toggle source

Get the info Endemic Code Smells :reek:UtilityFunction

# File lib/mysh/show/env.rb, line 23
def info
  [["about",     Mysh::DESCRIPTION],
   ["version",   Mysh::VERSION],
   ["installed", Gem::Specification.find_all_by_name("mysh")
                                   .map{|s| s.version.to_s}
                                   .join(", ")],
   ["latest",    insouciant {latest_version_for("mysh").to_s}],
   ["init file", $mysh_init_file.to_host_spec],
   ["user",      ENV['USER']],
   ["home",      (ENV['HOME'] || "").to_host_spec],
   ["name",      (t = MNV[:name]).empty? ? $PROGRAM_NAME.to_host_spec : t],
   ["os shell",  (ENV['SHELL'] || ENV['ComSpec'] || "").to_host_spec],
   ["host",      ENV['HOSTNAME'] || ENV['COMPUTERNAME']],
   ["os",        ENV['OS']],
   ["platform",  MiniTerm::TERM_PLATFORM],
   ["java?",     MiniTerm.java? ? true : false],
   ["PID",       $PROCESS_ID]
  ]
end
path() click to toggle source

Get the path. Endemic Code Smells :reek:UtilityFunction

# File lib/mysh/show/env.rb, line 45
def path
  [["path"].concat(ENV['PATH'].split(File::PATH_SEPARATOR))]
end