Class: Gem::Resolver::SourceSet
- 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
Instance Method Summary collapse
- #add_source_gem(name, source) ⇒ Object
-
#find_all(req) ⇒ Object
:nodoc:.
-
#initialize ⇒ SourceSet
constructor
Creates a SourceSet for the given
sources
or Gem::sources if none are specified. -
#prefetch(reqs) ⇒ Object
potentially no-op.
Methods inherited from Set
Constructor Details
#initialize ⇒ SourceSet
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 |