commands/plugin: ignore default gems when pruning
For modern RubyGems compatibility
This commit is contained in:
parent
255608d9c5
commit
4f17a70c4e
|
@ -38,9 +38,14 @@ module VagrantPlugins
|
||||||
|
|
||||||
# Get the actual specifications of installed gems
|
# Get the actual specifications of installed gems
|
||||||
all_specs = env[:gem_helper].with_environment do
|
all_specs = env[:gem_helper].with_environment do
|
||||||
result = []
|
[].tap do |result|
|
||||||
Gem::Specification.find_all { |s| result << s }
|
Gem::Specification.find_all do |s|
|
||||||
result
|
# Ignore default gems since they can't be uninstalled
|
||||||
|
next if s.respond_to?(:default_gem?) && s.default_gem?
|
||||||
|
|
||||||
|
result << s
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# The list of specs to prune initially starts out as all of them
|
# The list of specs to prune initially starts out as all of them
|
||||||
|
|
Loading…
Reference in New Issue