ruby/lib/rubygems/commands/search_command.rb
nagachika 589da706be * lib/rubygems: Update to RubyGems 2.0.6. [ruby-core:56160]
[Backport #8682]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-25 15:42:22 +00:00

33 lines
616 B
Ruby

require 'rubygems/command'
require 'rubygems/commands/query_command'
class Gem::Commands::SearchCommand < Gem::Commands::QueryCommand
def initialize
super 'search', 'Display all gems whose name contains STRING'
remove_option '--name-matches'
defaults[:domain] = :remote
end
def arguments # :nodoc:
"STRING fragment of gem name to search for"
end
def defaults_str # :nodoc:
"--remote --no-details"
end
def usage # :nodoc:
"#{program_name} [STRING]"
end
def execute
string = get_one_optional_argument
options[:name] = /#{string}/i
super
end
end