# File lib/bundler/installer/parallel_installer.rb, line 9 def initialize(spec) @spec = spec @name = spec.name @state = :none @post_install_message = "" @error = nil end
Represents all dependencies
# File lib/bundler/installer/parallel_installer.rb, line 68 def all_dependencies @spec.dependencies end
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 55 def dependencies(all_spec_names) @dependencies ||= begin deps = all_dependencies.reject {|dep| ignorable_dependency? dep } missing = deps.reject {|dep| all_spec_names.include? dep.name } unless missing.empty? raise Bundler::LockfileError, "Your Gemfile.lock is corrupt. The following #{missing.size > 1 ? "gems are" : "gem is"} missing " "from the DEPENDENCIES section: '#{missing.map(&:name).join('\' \'')}'" end deps end end
Checks installed dependencies against spec's dependencies to make sure needed dependencies have been installed.
# File lib/bundler/installer/parallel_installer.rb, line 48 def dependencies_installed?(all_specs) installed_specs = all_specs.select(&:installed?).map(&:name) dependencies(all_specs.map(&:name)).all? {|d| installed_specs.include? d.name } end
# File lib/bundler/installer/parallel_installer.rb, line 21 def enqueued? state == :enqueued end
# File lib/bundler/installer/parallel_installer.rb, line 25 def failed? state == :failed end
# File lib/bundler/installer/parallel_installer.rb, line 38 def has_post_install_message? !post_install_message.empty? end
# File lib/bundler/installer/parallel_installer.rb, line 42 def ignorable_dependency?(dep) dep.type == :development || dep.name == @name end
# File lib/bundler/installer/parallel_installer.rb, line 29 def installation_attempted? installed? || failed? end
# File lib/bundler/installer/parallel_installer.rb, line 17 def installed? state == :installed end
Only true when spec in neither installed nor already enqueued
# File lib/bundler/installer/parallel_installer.rb, line 34 def ready_to_enqueue? !enqueued? && !installation_attempted? end