Class: Gem::Commands::FerretCommand
- Inherits:
-
QueryCommand
- Object
- QueryCommand
- Gem::Commands::FerretCommand
- Defined in:
- lib/rubygems/commands/ferret_command.rb
Overview
A fulltext search for gems using rubypan.org
Instance Method Summary collapse
-
#arguments ⇒ Object
:nodoc:.
-
#defaults_str ⇒ Object
:nodoc:.
- #execute ⇒ Object
-
#initialize ⇒ FerretCommand
constructor
A new instance of FerretCommand.
-
#usage ⇒ Object
:nodoc:.
Constructor Details
#initialize ⇒ FerretCommand
Returns a new instance of FerretCommand.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rubygems/commands/ferret_command.rb', line 9 def initialize super 'ferret', 'Search for text in gemspec fields via rubypan.org' remove_option '--name-matches' remove_option '--all' remove_option '--version' remove_option '-i' remove_option '--local' remove_option '--remote' remove_option '--both' end |
Instance Method Details
#arguments ⇒ Object
:nodoc:
22 23 24 |
# File 'lib/rubygems/commands/ferret_command.rb', line 22 def arguments # :nodoc: "TEXT text to serach for" end |
#defaults_str ⇒ Object
:nodoc:
26 27 28 |
# File 'lib/rubygems/commands/ferret_command.rb', line 26 def defaults_str # :nodoc: "--no-details" end |
#execute ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/rubygems/commands/ferret_command.rb', line 34 def execute search = URI.escape [:args].join(' ') search_uri = URI.parse "http://rubypan.org/search.Marshal?q=#{search}" data = Gem::RemoteFetcher.fetcher.fetch_path search_uri spec_tuples = Marshal.load data output_query_results spec_tuples end |
#usage ⇒ Object
:nodoc:
30 31 32 |
# File 'lib/rubygems/commands/ferret_command.rb', line 30 def usage # :nodoc: "#{program_name} [TEXT]" end |