aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/commands
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/commands')
-rw-r--r--lib/rubygems/commands/cleanup_command.rb29
-rw-r--r--lib/rubygems/commands/query_command.rb4
2 files changed, 21 insertions, 12 deletions
diff --git a/lib/rubygems/commands/cleanup_command.rb b/lib/rubygems/commands/cleanup_command.rb
index f18a94d7a2..a7071ce679 100644
--- a/lib/rubygems/commands/cleanup_command.rb
+++ b/lib/rubygems/commands/cleanup_command.rb
@@ -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
-
- gems_to_cleanup = gems_to_cleanup.select { |spec|
- primary_gems[spec.name].version != spec.version
+ 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 = 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
diff --git a/lib/rubygems/commands/query_command.rb b/lib/rubygems/commands/query_command.rb
index b6c910d449..020bc297b4 100644
--- a/lib/rubygems/commands/query_command.rb
+++ b/lib/rubygems/commands/query_command.rb
@@ -132,8 +132,8 @@ class Gem::Commands::QueryCommand < Gem::Command
if options[:name].source.empty?
spec_tuples = fetcher.detect(type) { true }
else
- spec_tuples = fetcher.detect(type) do |gem_name, ver, plat|
- options[:name] === gem_name
+ spec_tuples = fetcher.detect(type) do |name_tuple|
+ options[:name] === name_tuple.name
end
end