123456789_123456789_123456789_123456789_123456789_

Class: Bundler::ParallelInstaller::SpecInstallation

Relationships & Source Files
Inherits: Object
Defined in: lib/bundler/installer/parallel_installer.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(spec) ⇒ SpecInstallation

[ GitHub ]

  
# File 'lib/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

Instance Attribute Details

#enqueued?Boolean (readonly)

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 23

def enqueued?
  state == :enqueued
end

#error (rw)

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 9

attr_accessor :spec, :name, :full_name, :post_install_message, :state, :error

#failed?Boolean (readonly)

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 27

def failed?
  state == :failed
end

#full_name (rw)

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 9

attr_accessor :spec, :name, :full_name, :post_install_message, :state, :error

#has_post_install_message?Boolean (readonly)

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 35

def has_post_install_message?
  !post_install_message.empty?
end

#installed?Boolean (readonly)

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 19

def installed?
  state == :installed
end

#name (rw)

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 9

attr_accessor :spec, :name, :full_name, :post_install_message, :state, :error

#post_install_message (rw)

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 9

attr_accessor :spec, :name, :full_name, :post_install_message, :state, :error

#ready_to_enqueue?Boolean (readonly)

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 31

def ready_to_enqueue?
  state == :none
end

#spec (rw)

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 9

attr_accessor :spec, :name, :full_name, :post_install_message, :state, :error

#state (rw)

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 9

attr_accessor :spec, :name, :full_name, :post_install_message, :state, :error

Instance Method Details

#all_dependencies

Represents all dependencies

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 56

def all_dependencies
  @spec.dependencies
end

#dependencies

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

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 51

def dependencies
  @dependencies ||= all_dependencies.reject {|dep| ignorable_dependency? dep }
end

#dependencies_installed?(installed_specs) ⇒ Boolean

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

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 45

def dependencies_installed?(installed_specs)
  dependencies.all? {|d| installed_specs.include? d.name }
end

#ignorable_dependency?(dep) ⇒ Boolean

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 39

def ignorable_dependency?(dep)
  dep.type == :development || dep.name == @name
end

#to_s

[ GitHub ]

  
# File 'lib/bundler/installer/parallel_installer.rb', line 60

def to_s
  "#<#{self.class} #{full_name} (#{state})>"
end