summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands/query_command.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-22 08:24:42 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-22 08:24:42 +0000
commit372dcece3f69989d133f720468f1e24aa1133cda (patch)
treec173ca48a23ce18afa44feb15bf68d2dd14ac619 /lib/rubygems/commands/query_command.rb
parentd0e5a34ac7c34e70c145024a0fed8f6042814f29 (diff)
Update to RubyGems 1.3.7.pre.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands/query_command.rb')
-rw-r--r--lib/rubygems/commands/query_command.rb19
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/rubygems/commands/query_command.rb b/lib/rubygems/commands/query_command.rb
index 7dd0a4a0d6e..93b417015c5 100644
--- a/lib/rubygems/commands/query_command.rb
+++ b/lib/rubygems/commands/query_command.rb
@@ -21,7 +21,7 @@ class Gem::Commands::QueryCommand < Gem::Command
options[:installed] = value
end
- add_version_option
+ add_version_option command, "for use with --installed"
add_option('-n', '--name-matches REGEXP',
'Name of gem(s) to query on matches the',
@@ -185,8 +185,21 @@ class Gem::Commands::QueryCommand < Gem::Command
entry = gem_name.dup
if options[:versions] then
- versions = matching_tuples.map { |(name, version,_),_| version }.uniq
- entry << " (#{versions.join ', '})"
+ list = if platforms.empty? or options[:details] then
+ matching_tuples.map { |(name, version,_),_| version }.uniq
+ else
+ platforms.sort.reverse.map do |version, pls|
+ if pls == [Gem::Platform::RUBY] then
+ version
+ else
+ ruby = pls.delete Gem::Platform::RUBY
+ platform_list = [ruby, *pls.sort].compact
+ "#{version} #{platform_list.join ' '}"
+ end
+ end
+ end.join ', '
+
+ entry << " (#{list})"
end
if options[:details] then