| Server IP : 217.160.0.244 / Your IP : 216.73.216.36 Web Server : Apache System : Linux infong-eu155 4.4.400-icpu-108 #2 SMP Wed Feb 11 11:51:01 UTC 2026 x86_64 User : u100174116 ( 6746176) PHP Version : 8.5.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/ruby/3.3.0/rubygems/resolver/ |
Upload File : |
# frozen_string_literal: true
##
# The BestSet chooses the best available method to query a remote index.
#
# It combines IndexSet and APISet
class Gem::Resolver::BestSet < Gem::Resolver::ComposedSet
##
# Creates a BestSet for the given +sources+ or Gem::sources if none are
# specified. +sources+ must be a Gem::SourceList.
def initialize(sources = Gem.sources)
super()
@sources = sources
end
##
# Picks which sets to use for the configured sources.
def pick_sets # :nodoc:
@sources.each_source do |source|
@sets << source.dependency_resolver_set
end
end
def find_all(req) # :nodoc:
pick_sets if @remote && @sets.empty?
super
end
def prefetch(reqs) # :nodoc:
pick_sets if @remote && @sets.empty?
super
end
def pretty_print(q) # :nodoc:
q.group 2, "[BestSet", "]" do
q.breakable
q.text "sets:"
q.breakable
q.pp @sets
end
end
end