class Bundler::ParallelInstaller::SpecInstallation

Parent:
Object

Attributes

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

Public Class Methods

new(spec) Show source
# File lib/bundler/installer/parallel_installer.rb, line 10
def initialize(spec)
  @spec = spec
  @name = spec.name
  @state = :none
  @post_install_message = ""
  @error = nil
end

Public Instance Methods

all_dependencies() Show source
# File lib/bundler/installer/parallel_installer.rb, line 68
def all_dependencies
  @spec.dependencies
end

Represents all dependencies

dependencies() Show source
# File lib/bundler/installer/parallel_installer.rb, line 56
def dependencies
  @dependencies ||= begin
    all_dependencies.reject {|dep| ignorable_dependency? dep }
  end
end

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

dependencies_installed?(all_specs) Show source
# 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

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

enqueued?() Show source
# File lib/bundler/installer/parallel_installer.rb, line 22
def enqueued?
  state == :enqueued
end
failed?() Show source
# File lib/bundler/installer/parallel_installer.rb, line 26
def failed?
  state == :failed
end
has_post_install_message?() Show source
# File lib/bundler/installer/parallel_installer.rb, line 39
def has_post_install_message?
  !post_install_message.empty?
end
ignorable_dependency?(dep) Show source
# File lib/bundler/installer/parallel_installer.rb, line 43
def ignorable_dependency?(dep)
  dep.type == :development || dep.name == @name
end
installation_attempted?() Show source
# File lib/bundler/installer/parallel_installer.rb, line 30
def installation_attempted?
  installed? || failed?
end
installed?() Show source
# File lib/bundler/installer/parallel_installer.rb, line 18
def installed?
  state == :installed
end
missing_lockfile_dependencies(all_spec_names) Show source
# 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
ready_to_enqueue?() Show source
# File lib/bundler/installer/parallel_installer.rb, line 35
def ready_to_enqueue?
  !enqueued? && !installation_attempted?
end

Only true when spec in neither installed nor already enqueued

to_s() Show source
# File lib/bundler/installer/parallel_installer.rb, line 72
def to_s
  "#<#{self.class} #{@spec.full_name} (#{state})>"
end

Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.