class Bundler::ParallelInstaller::SpecInstallation

Attributes

error[RW]
full_name[RW]
name[RW]
post_install_message[RW]
spec[RW]
state[RW]

Public Class Methods

new(spec) click to toggle source
# File 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

Public Instance Methods

all_dependencies() click to toggle source

Represents all dependencies

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

Represents only the non-development dependencies, the ones that are itself and are in the total list.

# File bundler/installer/parallel_installer.rb, line 52
def dependencies
  @dependencies ||= all_dependencies.reject {|dep| ignorable_dependency? dep }
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 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?() click to toggle source
# File bundler/installer/parallel_installer.rb, line 23
def enqueued?
  state == :enqueued
end
failed?() click to toggle source
# File bundler/installer/parallel_installer.rb, line 27
def failed?
  state == :failed
end
has_post_install_message?() click to toggle source
# File bundler/installer/parallel_installer.rb, line 35
def has_post_install_message?
  !post_install_message.empty?
end
ignorable_dependency?(dep) click to toggle source
# File bundler/installer/parallel_installer.rb, line 39
def ignorable_dependency?(dep)
  dep.type == :development || dep.name == @name
end
installed?() click to toggle source
# File bundler/installer/parallel_installer.rb, line 19
def installed?
  state == :installed
end
missing_lockfile_dependencies(all_spec_names) click to toggle source
# File bundler/installer/parallel_installer.rb, line 56
def missing_lockfile_dependencies(all_spec_names)
  dependencies.reject {|dep| all_spec_names.include? dep.name }
end
ready_to_enqueue?() click to toggle source
# File bundler/installer/parallel_installer.rb, line 31
def ready_to_enqueue?
  state == :none
end
to_s() click to toggle source
# File bundler/installer/parallel_installer.rb, line 65
def to_s
  "#<#{self.class} #{full_name} (#{state})>"
end