Class: Bundler::ParallelInstaller::SpecInstallation
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/bundler/installer/parallel_installer.rb |
Class Method Summary
- .new(spec) ⇒ SpecInstallation constructor
Instance Attribute Summary
- #enqueued? ⇒ Boolean readonly
- #error rw
- #failed? ⇒ Boolean readonly
- #has_post_install_message? ⇒ Boolean readonly
- #installation_attempted? ⇒ Boolean readonly
- #installed? ⇒ Boolean readonly
- #name rw
- #post_install_message rw
-
#ready_to_enqueue? ⇒ Boolean
readonly
Only true when spec in neither installed nor already enqueued.
- #spec rw
- #state rw
Instance Method Summary
-
#all_dependencies
Represents all dependencies.
-
#dependencies
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.
- #ignorable_dependency?(dep) ⇒ Boolean
- #missing_lockfile_dependencies(all_spec_names)
- #to_s
Constructor Details
.new(spec) ⇒ SpecInstallation
Instance Attribute Details
#enqueued? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/bundler/installer/parallel_installer.rb', line 22
def enqueued? state == :enqueued end
#error (rw)
[ GitHub ]
#failed? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/bundler/installer/parallel_installer.rb', line 26
def failed? state == :failed end
#has_post_install_message? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/bundler/installer/parallel_installer.rb', line 39
def ! .empty? end
#installation_attempted? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/bundler/installer/parallel_installer.rb', line 30
def installation_attempted? installed? || failed? end
#installed? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/bundler/installer/parallel_installer.rb', line 18
def installed? state == :installed end
#name (rw)
[ GitHub ]#post_install_message (rw)
[ GitHub ]
#ready_to_enqueue? ⇒ Boolean
(readonly)
Only true when spec in neither installed nor already enqueued
# File 'lib/bundler/installer/parallel_installer.rb', line 35
def ready_to_enqueue? !enqueued? && !installation_attempted? end
#spec (rw)
[ GitHub ]#state (rw)
[ GitHub ]Instance Method Details
#all_dependencies
Represents all dependencies
# File 'lib/bundler/installer/parallel_installer.rb', line 68
def all_dependencies @spec.dependencies end
#dependencies
Represents only the non-development dependencies, the ones that are itself and are in the total list.
# File 'lib/bundler/installer/parallel_installer.rb', line 56
def dependencies @dependencies ||= begin all_dependencies.reject {|dep| ignorable_dependency? dep } end end
#dependencies_installed?(all_specs) ⇒ Boolean
Checks installed dependencies against spec’s dependencies to make sure needed dependencies have been installed.
# File 'lib/bundler/installer/parallel_installer.rb', line 49
def dependencies_installed?(all_specs) installed_specs = all_specs.select(&:installed?).map(&:name) dependencies.all? {|d| installed_specs.include? d.name } end
#ignorable_dependency?(dep) ⇒ Boolean
# File 'lib/bundler/installer/parallel_installer.rb', line 43
def ignorable_dependency?(dep) dep.type == :development || dep.name == @name end
#missing_lockfile_dependencies(all_spec_names)
[ GitHub ]# File 'lib/bundler/installer/parallel_installer.rb', line 62
def missing_lockfile_dependencies(all_spec_names) deps = all_dependencies.reject {|dep| ignorable_dependency? dep } deps.reject {|dep| all_spec_names.include? dep.name } end
#to_s
[ GitHub ]# File 'lib/bundler/installer/parallel_installer.rb', line 72
def to_s "#<#{self.class} #{@spec.full_name} (#{state})>" end