lib/vagrant/bundler.rb in vagrant-unbundled-2.2.0.0 vs lib/vagrant/bundler.rb in vagrant-unbundled-2.2.2.0
- old
+ new
@@ -22,12 +22,12 @@
# Location of HashiCorp gem repository
HASHICORP_GEMSTORE = "https://gems.hashicorp.com/".freeze
# Default gem repositories
DEFAULT_GEM_SOURCES = [
- "https://rubygems.org/".freeze,
- HASHICORP_GEMSTORE
+ HASHICORP_GEMSTORE,
+ "https://rubygems.org/".freeze
].freeze
def self.instance
@bundler ||= self.new
end
@@ -60,10 +60,15 @@
Gem::Specification.reset
end
# Add HashiCorp RubyGems source
if !Gem.sources.include?(HASHICORP_GEMSTORE)
+ current_sources = Gem.sources.sources.dup
+ Gem.sources.clear
Gem.sources << HASHICORP_GEMSTORE
+ current_sources.each do |src|
+ Gem.sources << src
+ end
end
# Generate dependencies for all registered plugins
plugin_deps = plugins.map do |name, info|
Gem::Dependency.new(name, info['installed_gem_version'].to_s.empty? ? '> 0' : info['installed_gem_version'])