aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/commands/query_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/commands/query_command.rb')
-rw-r--r--lib/rubygems/commands/query_command.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rubygems/commands/query_command.rb b/lib/rubygems/commands/query_command.rb
index 581d4bb734..4f957625ee 100644
--- a/lib/rubygems/commands/query_command.rb
+++ b/lib/rubygems/commands/query_command.rb
@@ -82,8 +82,10 @@ class Gem::Commands::QueryCommand < Gem::Command
end
entry = gem_name.dup
+
if options[:versions] then
- entry << " (#{list_of_matching.map{|gem| gem.version.to_s}.join(", ")})"
+ versions = list_of_matching.map { |s| s.version }.uniq
+ entry << " (#{versions.join ', '})"
end
entry << "\n" << format_text(list_of_matching[0].summary, 68, 4) if