Class: Pod::Command::Search

Inherits:
Pod::Command show all
Defined in:
lib/cocoapods/command/search.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pod::Command

parse, run

Methods included from Pod::Config::Mixin

#config

Constructor Details

#initialize(argv) ⇒ Search

Returns a new instance of Search.



19
20
21
22
23
24
# File 'lib/cocoapods/command/search.rb', line 19

def initialize(argv)
  @full_text_search = argv.option('--full')
  unless @query = argv.arguments.first
    super
  end
end

Class Method Details



4
5
6
7
8
9
10
11
12
# File 'lib/cocoapods/command/search.rb', line 4

def self.banner
%{Search pods:

    $ pod search [QUERY]

Searches for pods, ignoring case, whose name matches `QUERY'. If the
`--full' option is specified, this will also search in the summary and
description of the pods.}
end

.optionsObject



14
15
16
17
# File 'lib/cocoapods/command/search.rb', line 14

def self.options
  "    --full      Search by name, summary, and description\n" +
  super
end

Instance Method Details

#runObject



26
27
28
29
30
31
32
# File 'lib/cocoapods/command/search.rb', line 26

def run
  Source.search_by_name(@query.strip, @full_text_search).each do |set|
    puts "==> #{set.name} (#{set.versions.reverse.join(", ")})"
    puts "    #{set.specification.summary.strip}"
    puts
  end
end