2007-11-10 02:48:56 -05:00
|
|
|
require 'rubygems/command'
|
|
|
|
require 'rubygems/commands/query_command'
|
|
|
|
|
2008-06-17 18:04:18 -04:00
|
|
|
##
|
|
|
|
# An alternate to Gem::Commands::QueryCommand that searches for gems starting
|
2013-06-04 17:54:58 -04:00
|
|
|
# with the the supplied argument.
|
2008-06-17 18:04:18 -04:00
|
|
|
|
|
|
|
class Gem::Commands::ListCommand < Gem::Commands::QueryCommand
|
|
|
|
|
2013-07-08 18:41:03 -04:00
|
|
|
def initialize
|
2014-09-13 23:30:02 -04:00
|
|
|
super 'list', 'Display local gems whose name matches REGEXP'
|
2008-06-17 18:04:18 -04:00
|
|
|
|
|
|
|
remove_option('--name-matches')
|
|
|
|
end
|
|
|
|
|
|
|
|
def arguments # :nodoc:
|
2014-09-13 23:30:02 -04:00
|
|
|
"REGEXP regexp to look for in gem name"
|
2008-06-17 18:04:18 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def defaults_str # :nodoc:
|
|
|
|
"--local --no-details"
|
2007-11-10 02:48:56 -05:00
|
|
|
end
|
2008-06-17 18:04:18 -04:00
|
|
|
|
2013-09-14 04:59:02 -04: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 18:04:18 -04:00
|
|
|
def usage # :nodoc:
|
2013-09-18 17:29:41 -04:00
|
|
|
"#{program_name} [STRING ...]"
|
2008-06-17 18:04:18 -04:00
|
|
|
end
|
|
|
|
|
2007-11-10 02:48:56 -05:00
|
|
|
end
|
2008-06-17 18:04:18 -04:00
|
|
|
|