Class: Gem::Resolver::IndexSpecification
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/index_specification.rb |
Overview
Represents a possible Specification
object returned from IndexSet
. Used to delay needed to download full Specification
objects when only the name
and version
are needed.
Class Method Summary
-
.new(set, name, version, source, platform) ⇒ IndexSpecification
constructor
An IndexSpecification is created from the index format described in ‘gem help generate_index`.
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. |
#required_ruby_version | The required_ruby_version constraint for this specification. |
#required_rubygems_version | The required_ruby_version constraint for this specification. |
#set | The set this specification came from. |
#source | The source for this specification. |
#spec | The |
#version | The version of the gem for this specification. |
#local? |
Instance Method Summary
- #==(other)
-
#dependencies
The dependencies of the gem for this specification.
- #hash
-
#required_ruby_version
The required_ruby_version constraint for this specification.
-
#required_rubygems_version
The required_rubygems_version constraint for this specification.
- #inspect Internal use only
- #pretty_print(q) Internal use only
-
#spec
Internal use only
Fetches a
::Gem::Specification
for thisIndexSpecification
from the#source
.
Specification
- Inherited
#download, | |
#full_name | The name and version of the specification. |
#install | Installs this specification using the |
#fetch_development_dependencies | Fetches development dependencies if the source does not provide them by default (see |
Constructor Details
.new(set, name, version, source, platform) ⇒ IndexSpecification
An IndexSpecification is created from the index format described in ‘gem help generate_index`.
The set
contains other specifications for this (URL) source
.
The name
, version
and platform
are the name, version and platform of the gem.
Instance Method Details
#==(other)
[ GitHub ]# File 'lib/rubygems/resolver/index_specification.rb', line 59
def ==(other) self.class === other && @name == other.name && @version == other.version && @platform == other.platform end
#dependencies
The dependencies of the gem for this specification
# File 'lib/rubygems/resolver/index_specification.rb', line 34
def dependencies spec.dependencies end
#hash
[ GitHub ]# File 'lib/rubygems/resolver/index_specification.rb', line 66
def hash @name.hash ^ @version.hash ^ @platform.hash end
#inspect
# File 'lib/rubygems/resolver/index_specification.rb', line 70
def inspect # :nodoc: format("#<%s %s source %s>", self.class, full_name, @source) end
#pretty_print(q)
#required_ruby_version
The required_ruby_version constraint for this specification
A fallback is included because when generated, some marshalled specs have it set to nil
.
# File 'lib/rubygems/resolver/index_specification.rb', line 44
def required_ruby_version spec.required_ruby_version || Gem::Requirement.default end
#required_rubygems_version
The required_rubygems_version constraint for this specification
A fallback is included because the original version of the specification API didn’t include that field, so some marshalled specs in the index have it set to nil
.
# File 'lib/rubygems/resolver/index_specification.rb', line 55
def required_rubygems_version spec.required_rubygems_version || Gem::Requirement.default end
#spec
Fetches a ::Gem::Specification
for this IndexSpecification
from the #source
.