Class: Gem::SearchCommand
- Inherits:
-
QueryCommand
- Object
- Command
- QueryCommand
- Gem::SearchCommand
- Includes:
- CommandAids
- Defined in:
- lib/rubygems/gem_commands.rb
Instance Attribute Summary
Attributes inherited from Command
#command, #defaults, #options, #program_name, #summary
Instance Method Summary collapse
- #arguments ⇒ Object
- #defaults_str ⇒ Object
- #execute ⇒ Object
-
#initialize ⇒ SearchCommand
constructor
A new instance of SearchCommand.
- #usage ⇒ Object
Methods included from CommandAids
#begins?, #get_all_gem_names, #get_one_gem_name, #get_one_optional_argument
Methods included from LocalRemoteOptions
#add_local_remote_options, #local?, #remote?
Methods inherited from Command
add_common_option, #add_option, add_specific_extra_args, common_options, extra_args, extra_args=, #handles?, #invoke, #merge_options, #remove_option, #show_help, specific_extra_args, specific_extra_args_hash, #when_invoked
Methods included from DefaultUserInteraction
#ui, ui, #ui=, ui=, #use_ui, use_ui
Constructor Details
#initialize ⇒ SearchCommand
Returns a new instance of SearchCommand.
894 895 896 897 898 899 900 |
# File 'lib/rubygems/gem_commands.rb', line 894 def initialize super( 'search', 'Display all gems whose name contains STRING' ) remove_option('--name-matches') end |
Instance Method Details
#arguments ⇒ Object
910 911 912 |
# File 'lib/rubygems/gem_commands.rb', line 910 def arguments "STRING fragment of gem name to look for" end |
#defaults_str ⇒ Object
902 903 904 |
# File 'lib/rubygems/gem_commands.rb', line 902 def defaults_str "--local --no-details" end |
#execute ⇒ Object
914 915 916 917 918 |
# File 'lib/rubygems/gem_commands.rb', line 914 def execute string = get_one_optional_argument [:name] = /#{string}/i super end |
#usage ⇒ Object
906 907 908 |
# File 'lib/rubygems/gem_commands.rb', line 906 def usage "#{program_name} [STRING]" end |