Skip to content

Commit

Permalink
use Gem::Installer to skip resolver when ignoring dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
hone authored and indirect committed Dec 18, 2013
1 parent d8f12e2 commit d97fba1
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions lib/rubygems/commands/install_command.rb
Expand Up @@ -200,25 +200,31 @@ def install_gem name, version # :nodoc:

req = Gem::Requirement.create(version)

inst = Gem::DependencyInstaller.new options
if options[:ignore_dependencies]
inst = Gem::Installer.new name, options
inst.install
@installed_specs.push(inst.spec)
else
inst = Gem::DependencyInstaller.new options

if options[:explain]
request_set = inst.resolve_dependencies name, req
if options[:explain]
request_set = inst.resolve_dependencies name, req

puts "Gems to install:"
puts "Gems to install:"

request_set.specs.map { |s| s.full_name }.sort.each do |s|
puts " #{s}"
end
request_set.specs.map { |s| s.full_name }.sort.each do |s|
puts " #{s}"
end

return
else
inst.install name, req
end
return
else
inst.install name, req
end

@installed_specs.push(*inst.installed_gems)
@installed_specs.push(*inst.installed_gems)

show_install_errors inst.errors
show_install_errors inst.errors
end
end

def install_gems # :nodoc:
Expand Down

0 comments on commit d97fba1

Please sign in to comment.