Class: Bundler::ParallelInstaller

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/installer/parallel_installer.rb

Defined Under Namespace

Classes: SpecInstallation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(installer, all_specs, size, standalone, force) ⇒ ParallelInstaller

Returns a new instance of ParallelInstaller.



72
73
74
75
76
77
78
79
80
# File 'lib/bundler/installer/parallel_installer.rb', line 72

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

Instance Attribute Details

#sizeObject (readonly)

Returns the value of attribute size.



70
71
72
# File 'lib/bundler/installer/parallel_installer.rb', line 70

def size
  @size
end

Class Method Details

.call(*args) ⇒ Object



66
67
68
# File 'lib/bundler/installer/parallel_installer.rb', line 66

def self.call(*args)
  new(*args).call
end

Instance Method Details

#callObject



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/bundler/installer/parallel_installer.rb', line 82

def call
  if @rake
    do_install(@rake, 0)
    Gem::Specification.reset
  end

  if @size > 1
    install_with_worker
  else
    install_serially
  end

  handle_error if failed_specs.any?
  @specs
ensure
  worker_pool&.stop
end