# class Puppet::ModuleTool::Applications::Searcher

### Public Class Methods

new(term, forge, options = {}) click to toggle source
Calls superclass method Puppet::ModuleTool::Applications::Application.new

    # File lib/puppet/module_tool/applications/searcher.rb, line 6
    def initialize(term, forge, options = {})
      @term = term
      @forge = forge
      super(options)
    end

### Public Instance Methods

run() click to toggle source

    # File lib/puppet/module_tool/applications/searcher.rb, line 12
    def run
      results = {}
      begin
        results[:answers] = @forge.search(@term)
        results[:result] = :success
      rescue ForgeError => e
        results[:result] = :failure
        results[:error] = {
          :oneline   => e.message,
          :multiline => e.multiline,
        }
      end
      results
    end