Sha256: ce7a872d4271875ea48d1c26f31a9df3cac5490b53cf2391280276a698632cca

Contents?: true

Size: 963 Bytes

Versions: 13

Compression:

Stored size: 963 Bytes

Contents

require 'rubygems/command'
require 'rubygems/commands/query_command'

class Gem::Commands::SearchCommand < Gem::Commands::QueryCommand

  def initialize
    super 'search', 'Display remote 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 description # :nodoc:
    <<-EOF
The search command displays remote gems whose name contains the given
string.

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

  def usage # :nodoc:
    "#{program_name} [STRING]"
  end

  def execute
    string = get_one_optional_argument
    options[:name] = /#{string}/i
    super
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rubygems-update-2.1.11 lib/rubygems/commands/search_command.rb
rubygems-update-2.1.10 lib/rubygems/commands/search_command.rb
rubygems-update-2.1.9 lib/rubygems/commands/search_command.rb
rubygems-update-2.1.8 lib/rubygems/commands/search_command.rb
rubygems-update-2.1.7 lib/rubygems/commands/search_command.rb
rubygems-update-2.1.6 lib/rubygems/commands/search_command.rb
rubygems-update-2.1.5 lib/rubygems/commands/search_command.rb
rubygems-update-2.1.4 lib/rubygems/commands/search_command.rb
rubygems-update-2.1.3 lib/rubygems/commands/search_command.rb
rubygems-update-2.1.2 lib/rubygems/commands/search_command.rb
rubygems-update-2.1.1 lib/rubygems/commands/search_command.rb
rubygems-update-2.1.0 lib/rubygems/commands/search_command.rb
rubygems-update-2.1.0.rc.2 lib/rubygems/commands/search_command.rb