class GhInspector::Evidence

def inspector_could_not_create_report(error, query, inspector)

Called when there have been networking issues in creating the report.
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

def inspector_received_empty_report(report, inspector)

Called once the report has been received, but when there are no issues found.
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

def inspector_recieved_empty_report(report, inspector)

Deprecated: Please use `inspector_received_empty_report` instead.
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

def inspector_started_query(query, inspector)

Called just as the investigation has begun.
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

def inspector_successfully_received_report(report, inspector)

Called once the inspector has received a report with more than one issue.
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

def inspector_successfully_recieved_report(report, inspector)

Deprecated: Please use `inspector_successfully_received_report` instead.
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

def print_issue_full(issue)

def print_issue_full(issue)
  puts " - #{issue.title}"
  puts "   #{issue.html_url} [#{issue.state}] [#{issue.comments} comment#{issue.comments == 1 ? '' : 's'}]"
  puts "   #{Time.parse(issue.updated_at).to_pretty}"
  puts ""
end

def print_open_link_hint(newline = false)

def print_open_link_hint(newline = false)
  puts "" if newline
  puts "You can ⌘ + double-click on links to open them directly in your browser. 🔗" if /darwin/ =~ RUBY_PLATFORM
end