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.



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

def initialize
  super()

  @links = {}
  @sets  = {}
end

Instance Method Details

#add_source_gem(name, source) ⇒ Object



35
36
37
# File 'lib/rubygems/resolver/source_set.rb', line 35

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

#find_all(req) ⇒ Object

:nodoc:



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

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



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

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