Class: ParallelInstaller::SpecInstallation
- Inherits:
-
Object
- Object
- ParallelInstaller::SpecInstallation
- Defined in:
- lib/bundler/installer/parallel_installer.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#post_install_message ⇒ Object
Returns the value of attribute post_install_message.
-
#spec ⇒ Object
Returns the value of attribute spec.
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
-
#all_dependencies ⇒ Object
Represents all dependencies.
-
#dependencies ⇒ Object
Represents only the non-development dependencies and the ones that are itself.
-
#dependencies_installed?(all_specs) ⇒ Boolean
Checks installed dependencies against spec’s dependencies to make sure needed dependencies have been installed.
- #enqueued? ⇒ Boolean
- #has_post_install_message? ⇒ Boolean
- #ignorable_dependency?(dep) ⇒ Boolean
-
#initialize(spec) ⇒ SpecInstallation
constructor
A new instance of SpecInstallation.
- #installed? ⇒ Boolean
-
#ready_to_enqueue? ⇒ Boolean
Only true when spec in neither installed nor already enqueued.
Constructor Details
#initialize(spec) ⇒ SpecInstallation
Returns a new instance of SpecInstallation.
9 10 11 12 13 |
# File 'lib/bundler/installer/parallel_installer.rb', line 9 def initialize(spec) @spec, @name = spec, spec.name @state = :none @post_install_message = "" end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/bundler/installer/parallel_installer.rb', line 8 def name @name end |
#post_install_message ⇒ Object
Returns the value of attribute post_install_message.
8 9 10 |
# File 'lib/bundler/installer/parallel_installer.rb', line 8 def @post_install_message end |
#spec ⇒ Object
Returns the value of attribute spec.
8 9 10 |
# File 'lib/bundler/installer/parallel_installer.rb', line 8 def spec @spec end |
#state ⇒ Object
Returns the value of attribute state.
8 9 10 |
# File 'lib/bundler/installer/parallel_installer.rb', line 8 def state @state end |
Instance Method Details
#all_dependencies ⇒ Object
Represents all dependencies
50 51 52 |
# File 'lib/bundler/installer/parallel_installer.rb', line 50 def all_dependencies @spec.dependencies end |
#dependencies ⇒ Object
Represents only the non-development dependencies and the ones that are itself.
45 46 47 |
# File 'lib/bundler/installer/parallel_installer.rb', line 45 def dependencies @dependencies ||= all_dependencies.reject {|dep| ignorable_dependency? dep } end |
#dependencies_installed?(all_specs) ⇒ Boolean
Checks installed dependencies against spec’s dependencies to make sure needed dependencies have been installed.
38 39 40 41 |
# File 'lib/bundler/installer/parallel_installer.rb', line 38 def dependencies_installed?(all_specs) installed_specs = all_specs.select(&:installed?).map(&:name) dependencies.all? {|d| installed_specs.include? d.name } end |
#enqueued? ⇒ Boolean
19 20 21 |
# File 'lib/bundler/installer/parallel_installer.rb', line 19 def enqueued? state == :enqueued end |
#has_post_install_message? ⇒ Boolean
28 29 30 |
# File 'lib/bundler/installer/parallel_installer.rb', line 28 def !.empty? end |
#ignorable_dependency?(dep) ⇒ Boolean
32 33 34 |
# File 'lib/bundler/installer/parallel_installer.rb', line 32 def ignorable_dependency?(dep) dep.type == :development || dep.name == @name end |
#installed? ⇒ Boolean
15 16 17 |
# File 'lib/bundler/installer/parallel_installer.rb', line 15 def installed? state == :installed end |
#ready_to_enqueue? ⇒ Boolean
Only true when spec in neither installed nor already enqueued
24 25 26 |
# File 'lib/bundler/installer/parallel_installer.rb', line 24 def ready_to_enqueue? !installed? && !enqueued? end |