method
install_gem
v2_1_10 -
Show latest stable
- Class:
Gem::Commands::InstallCommand
install_gem(name, version)public
No documentation available.
# File lib/rubygems/commands/install_command.rb, line 197
def install_gem name, version # :nodoc:
return if options[:conservative] and
not Gem::Dependency.new(name, version).matching_specs.empty?
req = Gem::Requirement.create(version)
if options[:ignore_dependencies] then
install_gem_without_dependencies name, req
else
inst = Gem::DependencyInstaller.new options
if options[:explain]
request_set = inst.resolve_dependencies name, req
puts "Gems to install:"
request_set.specs.map { |s| s.full_name }.sort.each do |s|
puts " #{s}"
end
return
else
inst.install name, req
end
@installed_specs.push(*inst.installed_gems)
show_install_errors inst.errors
end
end