Class: Gem::Resolver::LockSpecification
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Specification
|
|
Instance Chain:
self,
Specification
|
|
Inherits: |
Gem::Resolver::Specification
|
Defined in: | lib/rubygems/resolver/lock_specification.rb |
Overview
The LockSpecification comes from a lockfile (Gem::RequestSet::Lockfile).
A LockSpecification's dependency information is pre-filled from the lockfile.
Class Method Summary
Specification - Inherited
.new | Sets default instance variables for the specification. |
Instance Attribute Summary
Specification - Inherited
#dependencies | The dependencies of the gem for this specification. |
#installable_platform? | Returns true if this specification is installable on this platform. |
#name | The name of the gem for this specification. |
#platform | The platform this gem works on. |
#set | The set this specification came from. |
#source | The source for this specification. |
#spec | The ::Gem::Specification for this Specification. |
#version | The version of the gem for this specification. |
Instance Method Summary
-
#install(options = {})
This is a null install as a locked specification is considered installed.
-
#spec
A specification constructed from the lockfile is returned.
Specification - Inherited
#full_name | The name and version of the specification. |
#install | Installs this specification using the ::Gem::Installer |
Constructor Details
.new(set, name, version, source, platform) ⇒ LockSpecification
# File 'lib/rubygems/resolver/lock_specification.rb', line 9
def initialize set, name, version, source, platform super() @name = name @platform = platform @set = set @source = source @version = version @dependencies = [] @spec = nil end
Instance Method Details
#install(options = {})
This is a null install as a locked specification is considered installed. options
are ignored.
#spec
A specification constructed from the lockfile is returned
# File 'lib/rubygems/resolver/lock_specification.rb', line 69
def spec @spec ||= Gem::Specification.find { |spec| spec.name == @name and spec.version == @version } @spec ||= Gem::Specification.new do |s| s.name = @name s.version = @version s.platform = @platform s.dependencies.concat @dependencies end end