In Files

  • bundler/installer/parallel_installer.rb

Class/Module Index [+]

Quicksearch

Bundler::ParallelInstaller

Attributes

size[R]

Public Class Methods

call(*args) click to toggle source
 
               # File bundler/installer/parallel_installer.rb, line 77
def self.call(*args)
  new(*args).call
end
            
new(installer, all_specs, size, standalone, force) click to toggle source
 
               # File bundler/installer/parallel_installer.rb, line 83
def initialize(installer, all_specs, size, standalone, force)
  @installer = installer
  @size = size
  @standalone = standalone
  @force = force
  @specs = all_specs.map {|s| SpecInstallation.new(s) }
  @spec_set = all_specs
  @rake = @specs.find {|s| s.name == "rake" }
end
            

Public Instance Methods

call() click to toggle source
 
               # File bundler/installer/parallel_installer.rb, line 93
def call
  check_for_corrupt_lockfile

  if @size > 1
    install_with_worker
  else
    install_serially
  end

  handle_error if @specs.any?(&:failed?)
  @specs
ensure
  worker_pool && worker_pool.stop
end
            
check_for_corrupt_lockfile() click to toggle source
 
               # File bundler/installer/parallel_installer.rb, line 108
def check_for_corrupt_lockfile
  missing_dependencies = @specs.map do |s|
    [
      s,
      s.missing_lockfile_dependencies(@specs.map(&:name)),
    ]
  end.reject {|a| a.last.empty? }
  return if missing_dependencies.empty?

  warning = []
  warning << "Your lockfile was created by an old Bundler that left some things out."
  if @size != 1
    warning << "Because of the missing DEPENDENCIES, we can only install gems one at a time, instead of installing #{@size} at a time."
    @size = 1
  end
  warning << "You can fix this by adding the missing gems to your Gemfile, running bundle install, and then removing the gems from your Gemfile."
  warning << "The missing gems are:"

  missing_dependencies.each do |spec, missing|
    warning << "* #{missing.map(&:name).join(", ")} depended upon by #{spec.name}"
  end

  Bundler.ui.warn(warning.join("\n"))
end