Class: Bundler::ParallelInstaller
- Inherits:
-
Object
- Object
- Bundler::ParallelInstaller
- Defined in:
- lib/bundler/installer/parallel_installer.rb
Defined Under Namespace
Classes: SpecInstallation
Instance Attribute Summary collapse
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(installer, all_specs, size, standalone, force, skip: nil) ⇒ ParallelInstaller
constructor
A new instance of ParallelInstaller.
Constructor Details
#initialize(installer, all_specs, size, standalone, force, skip: nil) ⇒ ParallelInstaller
Returns a new instance of ParallelInstaller.
71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/bundler/installer/parallel_installer.rb', line 71 def initialize(installer, all_specs, size, standalone, force, skip: nil) @installer = installer @size = size @standalone = standalone @force = force @specs = all_specs.map {|s| SpecInstallation.new(s) } @specs.each do |spec_install| spec_install.state = :installed if skip.include?(spec_install.name) end if skip @spec_set = all_specs @rake = @specs.find {|s| s.name == "rake" unless s.installed? } end |
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
69 70 71 |
# File 'lib/bundler/installer/parallel_installer.rb', line 69 def size @size end |
Class Method Details
.call(*args, **kwargs) ⇒ Object
65 66 67 |
# File 'lib/bundler/installer/parallel_installer.rb', line 65 def self.call(*args, **kwargs) new(*args, **kwargs).call end |
Instance Method Details
#call ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/bundler/installer/parallel_installer.rb', line 84 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 |