# File lib/puppet/module/tool/applications/searcher.rb, line 12 def run header "Searching #{repository}" request = Net::HTTP::Get.new("/modules.json?q=#{URI.escape(@term)}") response = repository.contact(request) case response when Net::HTTPOK matches = PSON.parse(response.body) if matches.empty? subheader "0 found." else subheader "#{matches.size} found." end matches.each do |match| puts "#{match['full_name']} (#{match['version']})" end else say "Could not execute search (HTTP #{response.code})" end end