123456789_123456789_123456789_123456789_123456789_

Class: Gem::Source::Vendor

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

Overview

This represents a vendored source that is similar to an installed gem.

Constant Summary

::Gem::Source - Inherited

FILES

Class Method Summary

Installed - Inherited

::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

Installed - Inherited

#<=>

Installed sources sort before all other sources.

#download

We don't need to download an installed gem.

#pretty_print

::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

.new(path) ⇒ Vendor

Creates a new Vendor source for a gem that was unpacked at Gem.path.

[ GitHub ]

  
# File 'lib/rubygems/source/vendor.rb', line 10

def initialize path
  @uri = path
end

Instance Method Details

#<=>(other)

[ GitHub ]

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

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