2016-02-01 12:43:26 +00:00
|
|
|
# frozen_string_literal: true
|
2007-11-10 07:48:56 +00:00
|
|
|
require 'rubygems/command'
|
2013-07-08 22:41:03 +00:00
|
|
|
require 'rubygems/commands/query_command'
|
2007-11-10 07:48:56 +00:00
|
|
|
|
2013-07-08 22:41:03 +00:00
|
|
|
class Gem::Commands::SearchCommand < Gem::Commands::QueryCommand
|
2009-03-06 03:56:38 +00:00
|
|
|
|
2009-06-09 21:38:59 +00:00
|
|
|
def initialize
|
2014-09-14 03:30:02 +00:00
|
|
|
super 'search', 'Display remote gems whose name matches REGEXP'
|
2009-06-09 21:38:59 +00:00
|
|
|
|
2013-07-08 22:41:03 +00:00
|
|
|
remove_option '--name-matches'
|
2013-07-22 22:46:50 +00:00
|
|
|
|
|
|
|
defaults[:domain] = :remote
|
2013-07-08 22:41:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def arguments # :nodoc:
|
2014-09-14 03:30:02 +00:00
|
|
|
"REGEXP regexp to search for in gem name"
|
2007-11-10 07:48:56 +00:00
|
|
|
end
|
2009-06-09 21:38:59 +00:00
|
|
|
|
|
|
|
def defaults_str # :nodoc:
|
2012-11-29 06:52:18 +00:00
|
|
|
"--remote --no-details"
|
2009-06-09 21:38:59 +00:00
|
|
|
end
|
|
|
|
|
2013-09-14 08:59:02 +00:00
|
|
|
def description # :nodoc:
|
|
|
|
<<-EOF
|
2014-09-14 03:30:02 +00:00
|
|
|
The search command displays remote gems whose name matches the given
|
|
|
|
regexp.
|
2013-09-14 08:59:02 +00:00
|
|
|
|
|
|
|
The --details option displays additional details from the gem but will
|
|
|
|
take a little longer to complete as it must download the information
|
|
|
|
individually from the index.
|
|
|
|
|
|
|
|
To list local gems use the list command.
|
|
|
|
EOF
|
|
|
|
end
|
|
|
|
|
2013-07-08 22:41:03 +00:00
|
|
|
def usage # :nodoc:
|
2014-09-14 03:30:02 +00:00
|
|
|
"#{program_name} [REGEXP]"
|
2013-07-08 22:41:03 +00:00
|
|
|
end
|
|
|
|
|
2007-11-10 07:48:56 +00:00
|
|
|
end
|
2009-06-09 21:38:59 +00:00
|
|
|
|