Class: Bundler::ParallelInstaller::SpecInstallation
- Inherits:
-
Object
- Object
- Bundler::ParallelInstaller::SpecInstallation
- Defined in:
- lib/bundler/installer/parallel_installer.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#full_name ⇒ Object
Returns the value of attribute full_name.
-
#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, the ones that are itself and are in the total list.
-
#dependencies_installed?(all_specs) ⇒ Boolean
Checks installed dependencies against spec’s dependencies to make sure needed dependencies have been installed.
- #enqueued? ⇒ Boolean
- #failed? ⇒ 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
- #to_s ⇒ Object
Constructor Details
#initialize(spec) ⇒ SpecInstallation
Returns a new instance of SpecInstallation.
10 11 12 13 14 15 16 17 |
# File 'lib/bundler/installer/parallel_installer.rb', line 10 def initialize(spec) @spec = spec @name = spec.name @full_name = spec.full_name @state = :none @post_install_message = "" @error = nil end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
9 10 11 |
# File 'lib/bundler/installer/parallel_installer.rb', line 9 def error @error end |
#full_name ⇒ Object
Returns the value of attribute full_name.
9 10 11 |
# File 'lib/bundler/installer/parallel_installer.rb', line 9 def full_name @full_name end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/bundler/installer/parallel_installer.rb', line 9 def name @name end |
#post_install_message ⇒ Object
Returns the value of attribute post_install_message.
9 10 11 |
# File 'lib/bundler/installer/parallel_installer.rb', line 9 def @post_install_message end |
#spec ⇒ Object
Returns the value of attribute spec.
9 10 11 |
# File 'lib/bundler/installer/parallel_installer.rb', line 9 def spec @spec end |
#state ⇒ Object
Returns the value of attribute state.
9 10 11 |
# File 'lib/bundler/installer/parallel_installer.rb', line 9 def state @state end |
Instance Method Details
#all_dependencies ⇒ Object
Represents all dependencies
57 58 59 |
# File 'lib/bundler/installer/parallel_installer.rb', line 57 def all_dependencies @spec.dependencies end |
#dependencies ⇒ Object
Represents only the non-development dependencies, the ones that are itself and are in the total list.
52 53 54 |
# File 'lib/bundler/installer/parallel_installer.rb', line 52 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.
45 46 47 48 |
# File 'lib/bundler/installer/parallel_installer.rb', line 45 def dependencies_installed?(all_specs) installed_specs = all_specs.select(&:installed?).map(&:name) dependencies.all? {|d| installed_specs.include? d.name } end |
#enqueued? ⇒ Boolean
23 24 25 |
# File 'lib/bundler/installer/parallel_installer.rb', line 23 def enqueued? state == :enqueued end |
#failed? ⇒ Boolean
27 28 29 |
# File 'lib/bundler/installer/parallel_installer.rb', line 27 def failed? state == :failed end |
#has_post_install_message? ⇒ Boolean
35 36 37 |
# File 'lib/bundler/installer/parallel_installer.rb', line 35 def !.empty? end |
#ignorable_dependency?(dep) ⇒ Boolean
39 40 41 |
# File 'lib/bundler/installer/parallel_installer.rb', line 39 def ignorable_dependency?(dep) dep.type == :development || dep.name == @name end |
#installed? ⇒ Boolean
19 20 21 |
# File 'lib/bundler/installer/parallel_installer.rb', line 19 def installed? state == :installed end |
#ready_to_enqueue? ⇒ Boolean
31 32 33 |
# File 'lib/bundler/installer/parallel_installer.rb', line 31 def ready_to_enqueue? state == :none end |
#to_s ⇒ Object
61 62 63 |
# File 'lib/bundler/installer/parallel_installer.rb', line 61 def to_s "#<#{self.class} #{full_name} (#{state})>" end |