Method: Pod::Source#search_by_name
- Defined in:
- lib/cocoapods-core/source.rb
permalink #search_by_name(query, full_text_search = false) ⇒ Array<Set>
TODO:
Rename to #search
Note:
full text search requires to load the specification for each pod, hence is considerably slower.
Returns The list of the sets that contain the search term.
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
# File 'lib/cocoapods-core/source.rb', line 302 def search_by_name(query, full_text_search = false) regexp_query = /#{query}/i if full_text_search pod_sets.reject do |set| texts = [] begin s = set.specification texts << s.name texts += s..keys texts << s.summary texts << s.description rescue CoreUI.warn "Skipping `#{set.name}` because the podspec " \ 'contains errors.' end texts.grep(regexp_query).empty? end else names = pods.grep(regexp_query) names.map { |pod_name| set(pod_name) } end end |