Class: Gem::Resolver::SourceSet

Inherits:
Set
  • Object
show all
Defined in:
lib/rubygems/resolver/source_set.rb

Overview

The SourceSet chooses the best available method to query a remote index.

Kind off like BestSet but filters the sources for gems

Instance Attribute Summary

Attributes inherited from Set

#errors, #prerelease, #remote

Instance Method Summary collapse

Methods inherited from Set

#remote?

Constructor Details

#initializeSourceSet

Creates a SourceSet for the given sources or Gem::sources if none are specified. sources must be a Gem::SourceList.



13
14
15
16
17
18
# File 'lib/rubygems/resolver/source_set.rb', line 13

def initialize
  super()

  @links = {}
  @sets  = {}
end

Instance Method Details

#add_source_gem(name, source) ⇒ Object



37
38
39
# File 'lib/rubygems/resolver/source_set.rb', line 37

def add_source_gem(name, source)
  @links[name] = source
end

#find_all(req) ⇒ Object

:nodoc:



20
21
22
23
24
25
26
# File 'lib/rubygems/resolver/source_set.rb', line 20

def find_all(req) # :nodoc:
  if set = get_set(req.dependency.name)
    set.find_all req
  else
    []
  end
end

#prefetch(reqs) ⇒ Object

potentially no-op



29
30
31
32
33
34
35
# File 'lib/rubygems/resolver/source_set.rb', line 29

def prefetch(reqs) # :nodoc:
  reqs.each do |req|
    if set = get_set(req.dependency.name)
      set.prefetch reqs
    end
  end
end