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
|
2013-09-13 19:58:57 +00:00
|
|
|
super 'search', 'Display all gems whose name contains STRING'
|
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:
|
|
|
|
"STRING fragment of gem name to search for"
|
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-07-08 22:41:03 +00:00
|
|
|
def usage # :nodoc:
|
|
|
|
"#{program_name} [STRING]"
|
|
|
|
end
|
|
|
|
|
|
|
|
def execute
|
|
|
|
string = get_one_optional_argument
|
|
|
|
options[:name] = /#{string}/i
|
|
|
|
super
|
|
|
|
end
|
|
|
|
|
2007-11-10 07:48:56 +00:00
|
|
|
end
|
2009-06-09 21:38:59 +00:00
|
|
|
|