Use the HashiCorp gem source for plugin installs

This commit is contained in:
Mitchell Hashimoto 2013-02-04 11:18:57 -08:00
parent c6a4bd529d
commit bc7237130d
1 changed files with 7 additions and 1 deletions

View File

@ -26,6 +26,11 @@ module VagrantPlugins
# Clear paths so that it reads the new GEM_HOME setting # Clear paths so that it reads the new GEM_HOME setting
Gem.paths = ENV Gem.paths = ENV
# Clear the sources so that installation uses custom sources
old_sources = Gem.sources
Gem.sources = Gem.default_sources
Gem.sources << "http://gems.hashicorp.com"
# Use a silent UI so that we have no output # Use a silent UI so that we have no output
Gem::DefaultUserInteraction.use_ui(Gem::SilentUI.new) do Gem::DefaultUserInteraction.use_ui(Gem::SilentUI.new) do
return yield return yield
@ -36,7 +41,8 @@ module VagrantPlugins
ENV["GEM_PATH"] = old_gem_path ENV["GEM_PATH"] = old_gem_path
# Reset everything # Reset everything
Gem.paths = ENV Gem.paths = ENV
Gem.sources = old_sources.to_a
end end
end end
end end