class ParallelInstaller::SpecInstallation

Attributes

name[RW]
post_install_message[RW]
spec[RW]
state[RW]

Public Class Methods

new(spec) click to toggle source
# File lib/bundler/installer/parallel_installer.rb, line 7
def initialize(spec)
  @spec = spec
  @name = spec.name
  @state = :none
  @post_install_message = ""
end

Public Instance Methods

all_dependencies() click to toggle source

Represents all dependencies

# File lib/bundler/installer/parallel_installer.rb, line 57
def all_dependencies
  @spec.dependencies
end
dependencies(all_spec_names) click to toggle source

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 44
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 }
    if missing.size > 0
      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
dependencies_installed?(all_specs) click to toggle source

Checks installed dependencies against spec's dependencies to make sure needed dependencies have been installed.

# File lib/bundler/installer/parallel_installer.rb, line 37
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
enqueued?() click to toggle source
# File lib/bundler/installer/parallel_installer.rb, line 18
def enqueued?
  state == :enqueued
end
has_post_install_message?() click to toggle source
# File lib/bundler/installer/parallel_installer.rb, line 27
def has_post_install_message?
  !post_install_message.empty?
end
ignorable_dependency?(dep) click to toggle source
# File lib/bundler/installer/parallel_installer.rb, line 31
def ignorable_dependency?(dep)
  dep.type == :development || dep.name == @name
end
installed?() click to toggle source
# File lib/bundler/installer/parallel_installer.rb, line 14
def installed?
  state == :installed
end
ready_to_enqueue?() click to toggle source

Only true when spec in neither installed nor already enqueued

# File lib/bundler/installer/parallel_installer.rb, line 23
def ready_to_enqueue?
  !installed? && !enqueued?
end