lib/pod/command/browser.rb in cocoapods-browser-0.0.1 vs lib/pod/command/browser.rb in cocoapods-browser-0.0.2
- old
+ new
@@ -21,28 +21,30 @@
extend Executable
executable :open
def run
- opened = false
- sets = SourcesManager.search_by_name(@query.join(' ').strip)
- statistics_provider = Config.instance.spec_statistics_provider
- sets.each do |set|
- begin
- pod = Specification::Set::Presenter.new(set, statistics_provider)
- next unless @query.include?(pod.name)
- if url = pod.homepage
- UI.puts("Opening #{url}")
- open!(url)
- opened = true
- else
- UI.warn "Skipping `#{set.name}` because the homepage not found."
+ @query.each do |query|
+ opened = false
+ sets = SourcesManager.search_by_name(query.strip, false)
+ statistics_provider = Config.instance.spec_statistics_provider
+ sets.each do |set|
+ begin
+ pod = Specification::Set::Presenter.new(set, statistics_provider)
+ next if query != pod.name
+ if url = pod.homepage
+ UI.puts("Opening #{url}")
+ open!(url)
+ opened = true
+ else
+ UI.warn "Skipping `#{set.name}` because the homepage not found."
+ end
+ rescue DSLError
+ UI.warn "Skipping `#{set.name}` because the podspec contains errors."
end
- rescue DSLError
- UI.warn "Skipping `#{set.name}` because the podspec contains errors."
end
+ UI.warn "The query(`#{query}`) not found pod." unless opened
end
- UI.warn "The query(`#{@query.join('` or `')}`) not found pod." unless opened
end
end
end
end