commands/plugin: ignore default gems when pruning

For modern RubyGems compatibility
This commit is contained in:
Mitchell Hashimoto 2013-12-03 23:48:06 -08:00
parent 255608d9c5
commit 4f17a70c4e
1 changed files with 8 additions and 3 deletions

View File

@ -38,9 +38,14 @@ module VagrantPlugins
# Get the actual specifications of installed gems
all_specs = env[:gem_helper].with_environment do
result = []
Gem::Specification.find_all { |s| result << s }
result
[].tap do |result|
Gem::Specification.find_all do |s|
# Ignore default gems since they can't be uninstalled
next if s.respond_to?(:default_gem?) && s.default_gem?
result << s
end
end
end
# The list of specs to prune initially starts out as all of them