class Gem::Commands::EnvironmentCommand
Public Class Methods
Source
# File lib/rubygems/commands/environment_command.rb, line 6definitializesuper"environment","Display information about the RubyGems environment"end
Calls superclass method
Gem::Command::newPublic Instance Methods
Source
# File lib/rubygems/commands/environment_command.rb, line 103defadd_path(out,path)path.eachdo|component|out<<" - #{component}\n"endend
Source
# File lib/rubygems/commands/environment_command.rb, line 75defexecuteout =String.newarg =options[:args][0]out<<caseargwhen/^version/thenGem::VERSIONwhen/^gemdir/,/^gemhome/,/^home/,/^GEM_HOME/thenGem.dirwhen/^gempath/,/^path/,/^GEM_PATH/thenGem.path.join(File::PATH_SEPARATOR)when/^user_gemdir/,/^user_gemhome/thenGem.user_dirwhen/^remotesources/thenGem.sources.to_a.join("\n")when/^platform/thenGem.platforms.join(File::PATH_SEPARATOR)when/^credentials/,/^creds/thenGem.configuration.credentials_pathwhennilthenshow_environmentelseraiseGem::CommandLineError,"Unknown environment option [#{arg}]"endsayouttrueend
Private Instance Methods
Source
# File lib/rubygems/commands/environment_command.rb, line 170defgit_pathexts =ENV["PATHEXT"]?ENV["PATHEXT"].split(";"): [""]ENV["PATH"].split(File::PATH_SEPARATOR).eachdo|path|exts.eachdo|ext|exe =File.join(path,"git#{ext}")returnexeifFile.executable?(exe)&&!File.directory?(exe)endendnilend
Git binary path