6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/html_proofer/reporter/terminal.rb', line 6
def report
msg = failures.each_with_object([]) do |(check_name, failures), arr|
str = ["For the #{check_name} check, the following failures were found:\n"]
failures.each do |failure|
path_str = blank?(failure.path) ? "" : "At #{failure.path}"
line_str = failure.line.nil? ? "" : ":#{failure.line}"
path_and_line = "#{path_str}#{line_str}"
path_and_line = blank?(path_and_line) ? "" : "* #{path_and_line}:\n\n"
status_str = failure.status.nil? ? "" : " (status code #{failure.status})"
indent = blank?(path_and_line) ? "* " : " "
str << " \#{path_and_line}\#{indent}\#{failure.description}\#{status_str}\n MSG\n end\n\n arr << str.join(\"\\n\")\n end\n\n @logger.log(:error, msg.join(\"\\n\"))\nend\n"
|