Class: Gem::Resolver::BestSet
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
ComposedSet ,
Set
|
|
Instance Chain:
self,
ComposedSet ,
Set
|
|
Inherits: |
Gem::Resolver::ComposedSet
|
Defined in: | lib/rubygems/resolver/best_set.rb |
Overview
Class Method Summary
-
.new(sources = Gem.sources) ⇒ BestSet
constructor
Creates a
BestSet
for the given Gem.sources or Gem.sources if none are specified.
ComposedSet
- Inherited
.new | Creates a new |
Set
- Inherited
Instance Attribute Summary
ComposedSet
- Inherited
#prerelease= | When |
#remote= | Sets the remote network access for all composed sets. |
#sets |
Set
- Inherited
#errors | Errors encountered when resolving gems. |
#prerelease | When true, allows matching of requests to prerelease gems. |
#remote |
|
#remote? | When true, this set is allowed to access the network when looking up specifications or dependencies. |
Instance Method Summary
- #find_all(req) Internal use only
-
#pick_sets
Internal use only
Picks which sets to use for the configured sources.
- #prefetch(reqs) Internal use only
- #pretty_print(q) Internal use only
- #replace_failed_api_set(error) Internal use only
ComposedSet
- Inherited
Set
- Inherited
Constructor Details
.new(sources = Gem.sources) ⇒ BestSet
Creates a BestSet
for the given Gem.sources or Gem.sources if none are specified. Gem.sources must be a ::Gem::SourceList
.
Instance Method Details
#find_all(req)
This method is for internal use only.
[ GitHub ]
# File 'lib/rubygems/resolver/best_set.rb', line 27
def find_all(req) # :nodoc: pick_sets if @remote and @sets.empty? super rescue Gem::RemoteFetcher::FetchError => e replace_failed_api_set e retry end
#pick_sets
This method is for internal use only.
Picks which sets to use for the configured sources.
# 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)
This method is for internal use only.
[ GitHub ]
# File 'lib/rubygems/resolver/best_set.rb', line 37
def prefetch(reqs) # :nodoc: pick_sets if @remote and @sets.empty? super end
#pretty_print(q)
This method is for internal use only.
[ GitHub ]
# File 'lib/rubygems/resolver/best_set.rb', line 43
def pretty_print(q) # :nodoc: q.group 2, '[BestSet', ']' do q.breakable q.text 'sets:' q.breakable q.pp @sets end end
#replace_failed_api_set(error)
This method is for internal use only.
# File 'lib/rubygems/resolver/best_set.rb', line 60
def replace_failed_api_set(error) # :nodoc: uri = error.original_uri uri = URI uri unless URI === uri uri = uri + "." raise error unless api_set = @sets.find do |set| Gem::Resolver::APISet === set and set.dep_uri == uri end index_set = Gem::Resolver::IndexSet.new api_set.source @sets.map! do |set| next set unless set == api_set index_set end end