2007-11-10 07:48:56 +00:00
|
|
|
require 'rubygems/command'
|
|
|
|
require 'rubygems/commands/query_command'
|
|
|
|
|
2008-06-17 22:04:18 +00:00
|
|
|
##
|
|
|
|
# An alternate to Gem::Commands::QueryCommand that searches for gems starting
|
2013-06-04 21:54:58 +00:00
|
|
|
# with the the supplied argument.
|
2008-06-17 22:04:18 +00:00
|
|
|
|
|
|
|
class Gem::Commands::ListCommand < Gem::Commands::QueryCommand
|
|
|
|
|
2013-07-08 22:41:03 +00:00
|
|
|
def initialize
|
2013-09-14 08:59:02 +00:00
|
|
|
super 'list', 'Display local gems whose name starts with STRING'
|
2008-06-17 22:04:18 +00:00
|
|
|
|
|
|
|
remove_option('--name-matches')
|
|
|
|
end
|
|
|
|
|
|
|
|
def arguments # :nodoc:
|
|
|
|
"STRING start of gem name to look for"
|
|
|
|
end
|
|
|
|
|
|
|
|
def defaults_str # :nodoc:
|
|
|
|
"--local --no-details"
|
2007-11-10 07:48:56 +00:00
|
|
|
end
|
2008-06-17 22:04:18 +00:00
|
|
|
|
2013-09-14 08:59:02 +00:00
|
|
|
def description # :nodoc:
|
|
|
|
<<-EOF
|
|
|
|
The list command is used to view the gems you have installed locally.
|
|
|
|
|
|
|
|
The --details option displays additional details including the summary, the
|
|
|
|
homepage, the author, the locations of different versions of the gem.
|
|
|
|
|
|
|
|
To search for remote gems use the search command.
|
|
|
|
EOF
|
|
|
|
end
|
|
|
|
|
2008-06-17 22:04:18 +00:00
|
|
|
def usage # :nodoc:
|
2013-09-18 21:29:41 +00:00
|
|
|
"#{program_name} [STRING ...]"
|
2008-06-17 22:04:18 +00:00
|
|
|
end
|
|
|
|
|
2007-11-10 07:48:56 +00:00
|
|
|
end
|
2008-06-17 22:04:18 +00:00
|
|
|
|