Class: Gem::Resolver::BestSet
- Inherits:
-
ComposedSet
- Object
- Set
- ComposedSet
- Gem::Resolver::BestSet
- Defined in:
- lib/rubygems/resolver/best_set.rb
Overview
The BestSet chooses the best available method to query a remote index.
It combines IndexSet and APISet
Instance Attribute Summary
Attributes inherited from ComposedSet
Attributes inherited from Set
Instance Method Summary collapse
-
#find_all(req) ⇒ Object
:nodoc:.
-
#initialize(sources = Gem.sources) ⇒ BestSet
constructor
Creates a BestSet for the given
sources
or Gem::sources if none are specified. -
#pick_sets ⇒ Object
Picks which sets to use for the configured sources.
-
#prefetch(reqs) ⇒ Object
:nodoc:.
-
#pretty_print(q) ⇒ Object
:nodoc:.
Methods inherited from ComposedSet
Methods inherited from Set
Constructor Details
Instance Method Details
#find_all(req) ⇒ Object
:nodoc:
27 28 29 30 31 |
# File 'lib/rubygems/resolver/best_set.rb', line 27 def find_all req # :nodoc: pick_sets if @remote and @sets.empty? super end |
#pick_sets ⇒ Object
Picks which sets to use for the configured sources.
21 22 23 24 25 |
# File 'lib/rubygems/resolver/best_set.rb', line 21 def pick_sets # :nodoc: @sources.each_source do |source| @sets << source.dependency_resolver_set end end |
#prefetch(reqs) ⇒ Object
:nodoc:
33 34 35 36 37 |
# File 'lib/rubygems/resolver/best_set.rb', line 33 def prefetch reqs # :nodoc: pick_sets if @remote and @sets.empty? super end |
#pretty_print(q) ⇒ Object
:nodoc:
39 40 41 42 43 44 45 46 47 |
# File 'lib/rubygems/resolver/best_set.rb', line 39 def pretty_print q # :nodoc: q.group 2, '[BestSet', ']' do q.breakable q.text 'sets:' q.breakable q.pp @sets end end |