lib/pod/command/plugins/search.rb in cocoapods-plugins-0.2.0 vs lib/pod/command/plugins/search.rb in cocoapods-plugins-0.3.0

- old
+ new

@@ -1,6 +1,7 @@ require 'pod/command/plugins_helper' +require 'pod/command/gem_helper' module Pod class Command class Plugins # The search subcommand. @@ -8,23 +9,23 @@ # searching into the name, author description fields # class Search < Plugins self.summary = 'Search for known plugins' self.description = <<-DESC - Searches plugins whose name contains the given text - (ignoring case). + Searches plugins whose 'name' contains the given `QUERY`. + `QUERY` is a regular expression, ignoring case. - With --full, it also searches by author and description. + With `--full`, it also searches by 'author' and 'description'. DESC self.arguments = [ - ['QUERY', :required] + CLAide::Argument.new('QUERY', true), ] def self.options [ - ['--full', 'Search by name, author, and description'] + ['--full', 'Search by name, author, and description'], ].concat(super.reject { |option, _| option == '--silent' }) end def initialize(argv) @full_text_search = argv.flag?('full') @@ -42,9 +43,10 @@ end end def run plugins = PluginsHelper.matching_plugins(@query, @full_text_search) + GemHelper.download_and_cache_specs if self.verbose? UI.title "Available CocoaPods Plugins matching '#{@query}':" plugins.each do |plugin| PluginsHelper.print_plugin plugin, self.verbose? end