Sha256: ad35334c24d739d8ec8297eb3c2bdee3e818cf4e5b3f040577557e248d0daea5

Contents?: true

Size: 701 Bytes

Versions: 3

Compression:

Stored size: 701 Bytes

Contents

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

module Gem
  module Commands
    class ListCommand < QueryCommand

      def initialize
        super(
          'list',
          'Display all gems whose name starts with STRING'
        )
        remove_option('--name-matches')
      end

      def arguments # :nodoc:
        "STRING        start of gem name to look for"
      end

      def defaults_str # :nodoc:
        "--local --no-details"
      end

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubygems-update-0.9.5 lib/rubygems/commands/list_command.rb
rubygems-update-1.0.0 lib/rubygems/commands/list_command.rb
rubygems-update-1.0.1 lib/rubygems/commands/list_command.rb