123456789_123456789_123456789_123456789_123456789_

Class: Gem::Resolver::InstalledSpecification

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Gem::Resolver::SpecSpecification
Defined in: lib/rubygems/resolver/installed_specification.rb

Overview

An InstalledSpecification represents a gem that is already installed locally.

Class Method Summary

SpecSpecification - Inherited

.new

A SpecSpecification is created for a set for a ::Gem::Specification in spec.

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
#version

The version of the gem for this specification.

#local?

Instance Method Summary

SpecSpecification - Inherited

#dependencies

The dependencies of the gem for this specification.

#full_name

The name and version of the specification.

#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_rubygems_version constraint for this specification.

#version

The version of the gem for this specification.

Specification - Inherited

#download,
#full_name

The name and version of the specification.

#install

Installs this specification using the ::Gem::Installer options.

#fetch_development_dependencies

Fetches development dependencies if the source does not provide them by default (see APISpecification).

Constructor Details

This class inherits a constructor from Gem::Resolver::SpecSpecification

Instance Attribute Details

#installable_platform?Boolean (readonly)

Returns true if this gem is installable for the current platform.

[ GitHub ]

  
# File 'lib/rubygems/resolver/installed_specification.rb', line 25

def installable_platform?
  # BACKCOMPAT If the file is coming out of a specified file, then we
  # ignore the platform. This code can be removed in RG 3.0.
  return true if @source.kind_of? Gem::Source::SpecificFile

  super
end

Instance Method Details

#==(other)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rubygems/resolver/installed_specification.rb', line 8

def ==(other) # :nodoc:
  self.class === other &&
    @set  == other.set &&
    @spec == other.spec
end

#install(options = {}) {|nil| ... }

This is a null install as this specification is already installed. options are ignored.

Yields:

  • (nil)
[ GitHub ]

  
# File 'lib/rubygems/resolver/installed_specification.rb', line 18

def install(options = {})
  yield nil
end

#pretty_print(q)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rubygems/resolver/installed_specification.rb', line 33

def pretty_print(q) # :nodoc:
  q.group 2, "[InstalledSpecification", "]" do
    q.breakable
    q.text "name: #{name}"

    q.breakable
    q.text "version: #{version}"

    q.breakable
    q.text "platform: #{platform}"

    q.breakable
    q.text "dependencies:"
    q.breakable
    q.pp spec.dependencies
  end
end

#source

The source for this specification

[ GitHub ]

  
# File 'lib/rubygems/resolver/installed_specification.rb', line 54

def source
  @source ||= Gem::Source::Installed.new
end