123456789_123456789_123456789_123456789_123456789_

Class: Gem::Source::Installed

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
self, ::Gem::Source, Comparable
Inherits: Gem::Source
Defined in: lib/rubygems/source/installed.rb

Overview

Represents an installed gem. This is used for dependency resolution.

Constant Summary

::Gem::Source - Inherited

FILES

Class Method Summary

::Gem::Source - Inherited

.new

Creates a new ::Gem::Source which will use the index located at #uri.

Instance Attribute Summary

::Gem::Source - Inherited

#update_cache?

Returns true when it is possible and safe to update the cache directory.

#uri

The URI this source will fetch gems from.

Instance Method Summary

::Gem::Source - Inherited

#<=>

Sources are ordered by installation preference.

#cache_dir

Returns the local directory to write #uri to.

#download

Downloads spec and writes it to Gem.dir.

#fetch_spec

Fetches a specification for the given name_tuple.

#load_specs

Loads type kind of specs fetching from @uri if the on-disk cache is out of date.

#==,
#api_uri

Use an SRV record on the host to look up the true endpoint for the index.

#dependency_resolver_set

Returns a Set that can fetch specifications from this source.

#eql?

Alias for #==.

#hash, #pretty_print

Constructor Details

.newInstalled

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rubygems/source/installed.rb', line 7

def initialize # :nodoc:
  @uri = nil
end

Instance Method Details

#<=>(other)

Installed sources sort before all other sources

[ GitHub ]

  
# File 'lib/rubygems/source/installed.rb', line 14

def <=> other
  case other
  when Gem::Source::Git,
       Gem::Source::Lock,
       Gem::Source::Vendor then
    -1
  when Gem::Source::Installed then
    0
  when Gem::Source then
    1
  else
    nil
  end
end

#download(spec, path)

We don't need to download an installed gem

[ GitHub ]

  
# File 'lib/rubygems/source/installed.rb', line 32

def download spec, path
  nil
end

#pretty_print(q)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rubygems/source/installed.rb', line 36

def pretty_print q # :nodoc:
  q.text '[Installed]'
end