Class: Vagrant::Bundler::BuiltinSet
- Inherits:
-
Gem::Resolver::Set
- Object
- Gem::Resolver::Set
- Vagrant::Bundler::BuiltinSet
- Defined in:
- lib/vagrant/bundler.rb
Overview
This is a custom Gem::Resolver::Set for use with vagrant "system" gems. It allows the installed set of gems to be used for providing a solution while enforcing strict constraints. This ensures that plugins cannot "upgrade" gems that are builtin to vagrant itself.
Instance Method Summary collapse
- #add_builtin_spec(spec) ⇒ Object
- #find_all(req) ⇒ Object
-
#initialize ⇒ BuiltinSet
constructor
A new instance of BuiltinSet.
Constructor Details
#initialize ⇒ BuiltinSet
Returns a new instance of BuiltinSet.
487 488 489 490 491 |
# File 'lib/vagrant/bundler.rb', line 487 def initialize super @remote = false @specs = [] end |
Instance Method Details
#add_builtin_spec(spec) ⇒ Object
493 494 495 |
# File 'lib/vagrant/bundler.rb', line 493 def add_builtin_spec(spec) @specs.push(spec).uniq! end |
#find_all(req) ⇒ Object
497 498 499 500 501 502 503 504 |
# File 'lib/vagrant/bundler.rb', line 497 def find_all(req) @specs.select do |spec| allow_prerelease = spec.name == "vagrant" && Vagrant.prerelease? req.match?(spec, allow_prerelease) end.map do |spec| Gem::Resolver::InstalledSpecification.new(self, spec) end end |