From f778d706f7dc311e05d3125d77108590ee18d5bb Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 5 Jan 2014 21:37:24 -0800 Subject: [PATCH] core: set the Bundler UI in initialization --- lib/vagrant/bundler.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb index e44d58f10..8bda18f1e 100644 --- a/lib/vagrant/bundler.rb +++ b/lib/vagrant/bundler.rb @@ -18,6 +18,16 @@ module Vagrant def initialize @gem_home = ENV["GEM_HOME"] @gem_path = ENV["GEM_PATH"] + + # Set the Bundler UI to be a silent UI. We have to add the + # `silence` method to it because Bundler UI doesn't have it. + ::Bundler.ui = ::Bundler::UI.new + if !::Bundler.ui.respond_to?(:silence) + ui = ::Bundler.ui + def ui.silence(*args) + yield + end + end end # Initializes Bundler and the various gem paths so that we can begin @@ -38,15 +48,6 @@ module Vagrant ENV["GEM_PATH"] = "#{Vagrant.user_data_path.join("gems")}#{::File::PATH_SEPARATOR}#{@gem_path}" Gem.clear_paths - - # Do some additional Bundler initialization - ::Bundler.ui = ::Bundler::UI.new - if !::Bundler.ui.respond_to?(:silence) - ui = ::Bundler.ui - def ui.silence(*args) - yield - end - end end # Installs the list of plugins.