mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems/commands/cleanup_command.rb: Skip default gems when
cleaning up. * test/rubygems/test_gem_commands_cleanup_command.rb: Test for above. * lib/rubygems/commands/query_command.rb: Fixed listing remote gems. * lib/rubygems/dependency_installer.rb: Ignore non-files when looking for local gems. * test/rubygems/test_gem_dependency_installer.rb: Test for above. * lib/rubygems/uninstaller.rb: The user must confirm uninstalling gems that have dependencies. * test/rubygems/test_gem_uninstaller.rb: Test for above. * lib/rubygems.rb (module Gem): Updated version. * test/rubygems/*.pem: Updated to run in FIPS mode. * test/rubygems/test_gem_security.rb: ditto. * test/rubygems/test_gem_security_signer.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ee68f78c24
commit
75894547f5
37 changed files with 592 additions and 201 deletions
|
@ -47,16 +47,17 @@ are not removed.
|
|||
end
|
||||
end
|
||||
|
||||
gems_to_cleanup = unless options[:args].empty? then
|
||||
options[:args].map do |gem_name|
|
||||
Gem::Specification.find_all_by_name gem_name
|
||||
end.flatten
|
||||
else
|
||||
Gem::Specification.to_a
|
||||
end
|
||||
candidate_gems = unless options[:args].empty? then
|
||||
options[:args].map do |gem_name|
|
||||
Gem::Specification.find_all_by_name gem_name
|
||||
end.flatten
|
||||
else
|
||||
Gem::Specification.to_a
|
||||
end
|
||||
|
||||
gems_to_cleanup = gems_to_cleanup.select { |spec|
|
||||
primary_gems[spec.name].version != spec.version
|
||||
gems_to_cleanup = candidate_gems.select { |spec|
|
||||
!spec.default_gem? and
|
||||
primary_gems[spec.name].version != spec.version
|
||||
}
|
||||
|
||||
full = Gem::DependencyList.from_specs
|
||||
|
@ -102,6 +103,14 @@ are not removed.
|
|||
end
|
||||
|
||||
say "Clean Up Complete"
|
||||
|
||||
if Gem.configuration.really_verbose then
|
||||
skipped = candidate_gems.
|
||||
select { |spec| spec.default_gem? }.
|
||||
map { |spec| spec.full_name}
|
||||
|
||||
say "Skipped default gems: #{skipped.join ', '}"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue