class GhInspector::Evidence

The default user interface for the inspector, its public API should be considered the protocol for other classes wanting to provide a user interface.

Your custom objects will be verified at runtime that they conform to the protocol.

You can see the default implementation at [lib/evidence.rb](/orta/gh-issues-inspector/tree/master/lib/evidence.rb).

Both `search_query` and `search_exception` take your custom delegate as a 2nd optional parameter.

“` ruby require 'gh_inspector' inspector = GhInspector::Inspector.new “orta”, “eigen” inspector.search_exception an_error, ArtsyUI.new “`

or

“` ruby require 'gh_inspector' inspector = GhInspector::Inspector.new “fastlane”, “fastlane” inspector.search_query “Someone set us up the bomb”, FastlaneUI.new “`

Public Instance Methods

inspector_could_not_create_report(error, query, inspector) click to toggle source

Called when there have been networking issues in creating the report.

# File lib/gh_inspector/evidence.rb, line 72
def inspector_could_not_create_report(error, query, inspector)
  puts "Could not access the GitHub API, you may have better luck via the website."
  puts "https://github.com/#{inspector.repo_owner}/#{inspector.repo_name}/search?q=#{query}&type=Issues&utf8=✓"
  puts "Error: #{error.name}"
  print_open_link_hint(true)
end
inspector_received_empty_report(report, inspector) click to toggle source

Called once the report has been received, but when there are no issues found.

# File lib/gh_inspector/evidence.rb, line 65
def inspector_received_empty_report(report, inspector)
  puts "Found no similar issues. To create a new issue, please visit:"
  puts "https://github.com/#{inspector.repo_owner}/#{inspector.repo_name}/issues/new"
  print_open_link_hint(true)
end
inspector_recieved_empty_report(report, inspector) click to toggle source

Deprecated: Please use `inspector_received_empty_report` instead.

# File lib/gh_inspector/evidence.rb, line 59
def inspector_recieved_empty_report(report, inspector)
  warn "[DEPRECATION] `inspector_recieved_empty_report` is deprecated. Please use `inspector_received_empty_report` instead."
  inspector_received_empty_report(report, inspector)
end
inspector_started_query(query, inspector) click to toggle source

Called just as the investigation has begun.

# File lib/gh_inspector/evidence.rb, line 34
def inspector_started_query(query, inspector)
  puts "Looking for related GitHub issues on #{inspector.repo_owner}/#{inspector.repo_name}..."
  puts "Search query: #{query}" if inspector.verbose
  puts ""
end
inspector_successfully_received_report(report, inspector) click to toggle source

Called once the inspector has received a report with more than one issue.

# File lib/gh_inspector/evidence.rb, line 47
def inspector_successfully_received_report(report, inspector)
  report.issues[0..(NUMBER_OF_ISSUES_INLINE - 1)].each { |issue| print_issue_full(issue) }

  if report.issues.count > NUMBER_OF_ISSUES_INLINE
    puts "and #{report.total_results - NUMBER_OF_ISSUES_INLINE} more at: #{report.url}"
    puts ""
  end

  print_open_link_hint
end
inspector_successfully_recieved_report(report, inspector) click to toggle source

Deprecated: Please use `inspector_successfully_received_report` instead.

# File lib/gh_inspector/evidence.rb, line 41
def inspector_successfully_recieved_report(report, inspector)
  warn "[DEPRECATION] `inspector_successfully_recieved_report` is deprecated. Please use `inspector_successfully_received_report` instead."
  inspector_successfully_received_report(report, inspector)
end

Private Instance Methods

print_issue_full(issue) click to toggle source