Class: Gem::Source::Installed

Inherits:
Gem::Source show all
Defined in:
lib/rubygems/source/installed.rb

Overview

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

Direct Known Subclasses

Vendor

Constant Summary

Constants inherited from Gem::Source

FILES

Instance Attribute Summary

Attributes inherited from Gem::Source

#uri

Instance Method Summary collapse

Methods inherited from Gem::Source

#==, #api_uri, #cache_dir, #dependency_resolver_set, #fetch_spec, #hash, #load_specs, #pretty_print, #update_cache?

Constructor Details

#initializeInstalled

:nodoc:



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

def initialize # :nodoc:
  @uri = nil
end

Instance Method Details

#<=>(other) ⇒ Object

Installed sources sort before all other sources



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rubygems/source/installed.rb', line 13

def <=> other
  case other
  when 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) ⇒ Object

We don’t need to download an installed gem



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

def download spec, path
  nil
end