class GhInspector::Inspector

To get started using The Issues Inspector, you will need to create an inspector instance. This class is main public API for querying issues.

#### Getting Started

Create an instance of `GhInspector::Inspector`, you can then ask it to search based on your raised exception, or as a direct query yourself.

“` ruby require 'gh_inspector' inspector = GhInspector::Inspector.new “orta”, “eigen” # Either use an error: inspector.search_exception an_error, ArtsyUI.new # Or use a specific query: inspector.search_query “Someone set us up the bomb” “`

By default this would output:

“` Looking for related issues on CocoaPods/CocoaPods…

- undefined method `to_ary' for #<Pod::Specification name="iVersion">Did you mean? to_query
  https://github.com/CocoaPods/CocoaPods/issues/4748 [closed] [1 comment]

- NoMethodError - undefined method `to_ary' for Pod EAIntroView
  https://github.com/CocoaPods/CocoaPods/issues/4391 [closed] [15 comments]

- Do a search on GitHub for issues relating to a crash?
  https://github.com/CocoaPods/CocoaPods/issues/4391 [open] [3 comments]

and 10 more at: github.com/CocoaPods/CocoaPods/search?q=undefined+method+%60to_ary%27&type=Issues “`

Attributes

query[RW]
repo_name[RW]
repo_owner[RW]
sidekick[RW]
verbose[RW]

Public Class Methods

from_slug(slug) click to toggle source

Class init function with a “orta/project” style string

# File lib/gh_inspector/inspector.rb, line 45
def self.from_slug(slug)
  details = slug.split '/'
  Inspector.new details.first, details.last
end
new(repo_owner, repo_name, verbose: false) click to toggle source

Init function with “orta”, “project”

# File lib/gh_inspector/inspector.rb, line 51
def initialize(repo_owner, repo_name, verbose: false)
  self.repo_owner = repo_owner
  self.repo_name = repo_name
  self.verbose = verbose
  self.sidekick = Sidekick.new(self, repo_owner, repo_name)
end

Public Instance Methods

search_exception(exception, delegate = nil) click to toggle source

Will do some magic to try and pull out a reasonable search query for an exception, then searches with that

# File lib/gh_inspector/inspector.rb, line 60
def search_exception(exception, delegate = nil)
  query = ExceptionHound.new(exception).query
  search_query(query, delegate)
end
search_query(query, delegate = nil) click to toggle source

Queries for an specific search string

# File lib/gh_inspector/inspector.rb, line 66
def search_query(query, delegate = nil)
  delegate ||= Evidence.new
  sidekick.search(query, delegate)
end