Class: Gem::Resolver::Specification
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
| Subclasses: | |
| Inherits: | Object | 
| Defined in: | lib/rubygems/resolver/specification.rb | 
Overview
A Specification contains a subset of the information contained in a ::Gem::Specification.  Only the information necessary for dependency resolution in the resolver is included.
Class Method Summary
- 
    
      .new  ⇒ Specification 
    
    constructor
    Sets default instance variables for the specification. 
Instance Attribute Summary
- 
    
      #dependencies  
    
    readonly
    The dependencies of the gem for this specification. 
- 
    
      #installable_platform?  ⇒ Boolean 
    
    readonly
    Returns true if this specification is installable on this platform. 
- 
    
      #name  
    
    readonly
    The name of the gem for this specification. 
- 
    
      #platform  
    
    readonly
    The platform this gem works on. 
- 
    
      #required_ruby_version  
    
    readonly
    The required_ruby_version constraint for this specification. 
- 
    
      #required_rubygems_version  
    
    readonly
    The required_ruby_version constraint for this specification. 
- 
    
      #set  
    
    readonly
    The set this specification came from. 
- 
    
      #source  
    
    readonly
    The source for this specification. 
- 
    
      #spec  
    
    readonly
    The ::Gem::Specificationfor thisSpecification.
- 
    
      #version  
    
    readonly
    The version of the gem for this specification. 
- #local? ⇒ Boolean readonly Internal use only
Instance Method Summary
- #download(options)
- 
    
      #full_name  
    
    The name and version of the specification. 
- 
    
      #install(options = {}) {|installer| ... } 
    
    Installs this specification using the ::Gem::Installeroptions.
- 
    
      #fetch_development_dependencies  
    
    Internal use only
    Fetches development dependencies if the source does not provide them by default (see APISpecification).
Constructor Details
    .new  ⇒ Specification 
  
Sets default instance variables for the specification.
# File 'lib/rubygems/resolver/specification.rb', line 60
def initialize @dependencies = nil @name = nil @platform = nil @set = nil @source = nil @version = nil @required_ruby_version = Gem::Requirement.default @required_rubygems_version = Gem::Requirement.default end
Instance Attribute Details
#dependencies (readonly)
The dependencies of the gem for this specification
# File 'lib/rubygems/resolver/specification.rb', line 12
attr_reader :dependencies
    #installable_platform?  ⇒ Boolean  (readonly)
  
Returns true if this specification is installable on this platform.
# File 'lib/rubygems/resolver/specification.rb', line 119
def installable_platform? Gem::Platform.match_spec? spec end
    #local?  ⇒ Boolean  (readonly)
  
  # File 'lib/rubygems/resolver/specification.rb', line 123
def local? # :nodoc: false end
#name (readonly)
The name of the gem for this specification
# File 'lib/rubygems/resolver/specification.rb', line 17
attr_reader :name
#platform (readonly)
The platform this gem works on.
# File 'lib/rubygems/resolver/specification.rb', line 22
attr_reader :platform
#required_ruby_version (readonly)
The required_ruby_version constraint for this specification.
# File 'lib/rubygems/resolver/specification.rb', line 50
attr_reader :required_ruby_version
#required_rubygems_version (readonly)
The required_ruby_version constraint for this specification.
# File 'lib/rubygems/resolver/specification.rb', line 55
attr_reader :required_rubygems_version
#set (readonly)
The set this specification came from.
# File 'lib/rubygems/resolver/specification.rb', line 27
attr_reader :set
#source (readonly)
The source for this specification
# File 'lib/rubygems/resolver/specification.rb', line 32
attr_reader :source
#spec (readonly)
The ::Gem::Specification for this Specification.
Implementers, note that #install updates @spec, so be sure to cache the ::Gem::Specification in @spec when overriding.
# File 'lib/rubygems/resolver/specification.rb', line 40
attr_reader :spec
#version (readonly)
The version of the gem for this specification.
# File 'lib/rubygems/resolver/specification.rb', line 45
attr_reader :version
Instance Method Details
#download(options)
[ GitHub ]#fetch_development_dependencies
Fetches development dependencies if the source does not provide them by default (see APISpecification).
# File 'lib/rubygems/resolver/specification.rb', line 75
def fetch_development_dependencies # :nodoc: end
#full_name
The name and version of the specification.
Unlike Specification#full_name, the platform is not included.
# File 'lib/rubygems/resolver/specification.rb', line 83
def full_name "#{@name}-#{@version}" end
#install(options = {}) {|installer| ... }
Installs this specification using the ::Gem::Installer options.  The install method yields a ::Gem::Installer instance, which indicates the gem will be installed, or nil, which indicates the gem is already installed.
After installation #spec is updated to point to the just-installed specification.