类 Gem::Commands::InstallCommand
Gem
安装器命令行工具
请参阅 ‘gem help install`
公共类方法
new() 点击切换源代码
调用父类方法
Gem::Command::new
# File rubygems/commands/install_command.rb, line 24 def initialize defaults = Gem::DependencyInstaller::DEFAULT_OPTIONS.merge({ format_executable: false, lock: true, suggest_alternate: true, version: Gem::Requirement.default, without_groups: [], }) defaults.merge!(install_update_options) super "install", "Install a gem into the local repository", defaults add_install_update_options add_local_remote_options add_platform_option add_version_option add_prerelease_option "to be installed. (Only for listed gems)" @installed_specs = [] end
公共实例方法
execute() 点击切换源代码
# File rubygems/commands/install_command.rb, line 148 def execute if options.include? :gemdeps install_from_gemdeps return # not reached end @installed_specs = [] ENV.delete "GEM_PATH" if options[:install_dir].nil? check_version load_hooks exit_code = install_gems show_installed say update_suggestion if eligible_for_update? terminate_interaction exit_code end