123456789_123456789_123456789_123456789_123456789_

Class: Gem::Resolver::SourceSet

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Set
Instance Chain:
self, Set
Inherits: Gem::Resolver::Set
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

Class Method Summary

Instance Attribute Summary

Set - Inherited

#errors

Errors encountered when resolving gems.

#prerelease

When true, allows matching of requests to prerelease gems.

#remote

Set to true to disable network access for this set.

Instance Method Summary

Set - Inherited

#find_all

The find_all method must be implemented.

#prefetch

The #prefetch method may be overridden, but this is not necessary.

Constructor Details

.newSourceSet

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

[ GitHub ]

  
# File 'lib/rubygems/resolver/source_set.rb', line 12

def initialize
  super()

  @links = {}
  @sets  = {}
end

Instance Method Details

#add_source_gem(name, source)

[ GitHub ]

  
# File 'lib/rubygems/resolver/source_set.rb', line 36

def add_source_gem name, source
  @links[name] = source
end

#get_set(name) (private)

[ GitHub ]

  
# File 'lib/rubygems/resolver/source_set.rb', line 42

def get_set(name)
  link = @links[name]
  @sets[link] ||= Gem::Source.new(link).dependency_resolver_set if link
end