Class: Gem::Resolver::BestSet

Inherits:
ComposedSet show all
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

#sets

Instance Method Summary collapse

Methods inherited from ComposedSet

#find_all, #prefetch

Methods inherited from Set

#find_all, #prefetch

Constructor Details

#initialize(sources = Gem.sources) ⇒ BestSet

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



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

def initialize sources = Gem.sources
  super()

  sources.each_source do |source|
    @sets << source.dependency_resolver_set
  end
end

Instance Method Details

#pretty_print(q) ⇒ Object

:nodoc:



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

def pretty_print q # :nodoc:
  q.group 2, '[BestSet', ']' do
    q.breakable
    q.text 'sets:'

    q.breakable
    q.pp @sets
  end
end