Class: GhInspector::Evidence

Inherits:
Object
  • Object
show all
Defined in:
lib/gh_inspector/evidence.rb

Instance Method Summary collapse

Instance Method Details

#inspector_could_not_create_report(error, query, inspector) ⇒ Object

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



64
65
66
67
68
69
# File 'lib/gh_inspector/evidence.rb', line 64

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) ⇒ Object

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



57
58
59
60
61
# File 'lib/gh_inspector/evidence.rb', line 57

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) ⇒ Object

Deprecated: Please use ‘inspector_received_empty_report` instead



51
52
53
54
# File 'lib/gh_inspector/evidence.rb', line 51

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) ⇒ Object

Called just as the investigation has begun.



26
27
28
29
30
# File 'lib/gh_inspector/evidence.rb', line 26

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) ⇒ Object

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



39
40
41
42
43
44
45
46
47
48
# File 'lib/gh_inspector/evidence.rb', line 39

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) ⇒ Object

Deprecated: Please use ‘inspector_successfully_received_report` instead



33
34
35
36
# File 'lib/gh_inspector/evidence.rb', line 33

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