Class: Gem::Resolver::VaultSet
- Inherits:
-
Set
- Object
- Set
- Gem::Resolver::VaultSet
- Defined in:
- lib/rubygems/resolver/vault_set.rb
Overview
A VaultSet looks up specifications from a .gemv vault source.
Returns standard Gem::Resolver::IndexSpecification objects so the resolver’s install pipeline (download -> Gem::Installer) works unchanged.
Instance Method Summary collapse
- #find_all(req) ⇒ Object
-
#initialize(source) ⇒ VaultSet
constructor
A new instance of VaultSet.
- #prefetch(reqs) ⇒ Object
- #pretty_print(q) ⇒ Object
Constructor Details
#initialize(source) ⇒ VaultSet
Returns a new instance of VaultSet.
8 9 10 11 12 |
# File 'lib/rubygems/resolver/vault_set.rb', line 8 def initialize(source) super() @source = source @specs = source.load_specs(:complete) end |
Instance Method Details
#find_all(req) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rubygems/resolver/vault_set.rb', line 14 def find_all(req) @specs.select { |tuple| req.match?(tuple) }.map do |tuple| Gem::Resolver::IndexSpecification.new( self, tuple.name, tuple.version, @source, tuple.platform, ) end end |
#prefetch(reqs) ⇒ Object
26 |
# File 'lib/rubygems/resolver/vault_set.rb', line 26 def prefetch(reqs); end |
#pretty_print(q) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rubygems/resolver/vault_set.rb', line 28 def pretty_print(q) q.group 2, "[VaultSet", "]" do next if @specs.empty? q.breakable q.seplist @specs do |tuple| q.text tuple.full_name end end end |