Cleaning gems properly only removes them from the local dir

This commit is contained in:
Mitchell Hashimoto 2014-01-05 17:04:50 -08:00
parent eabc0f04fa
commit 2fd144611e
1 changed files with 8 additions and 2 deletions

View File

@ -64,6 +64,9 @@ module Vagrant
::Bundler::Installer.install(root, definition, opts)
end
# Clean out the unused gems, if we have any
clean(plugins)
definition.specs
rescue ::Bundler::VersionConflict => e
raise Errors::PluginInstallVersionConflict,
@ -76,8 +79,11 @@ module Vagrant
lockfile = "#{gemfile.path}.lock"
definition = ::Bundler::Definition.build(gemfile, lockfile, nil)
root = File.dirname(gemfile.path)
runtime = ::Bundler::Runtime.new(root, definition)
runtime.clean
with_isolated_gem do
runtime = ::Bundler::Runtime.new(root, definition)
runtime.clean
end
end
# Builds a valid Gemfile for use with Bundler given the list of