9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/gemxray/formatters/terminal.rb', line 9
def render(report)
lines = [HEADER, SEPARATOR, ""]
if report.results.empty?
lines << "No issues found."
else
report.results.each do |result|
lines << "[#{result.severity.to_s.upcase}] #{result.gem_name} (#{result.type_label})"
result.reasons.each_with_index do |reason, index|
marker = index == result.reasons.length - 1 ? "โโ" : "โโ"
lines << " #{marker} #{reason.detail}"
end
lines << ""
end
end
summary = report.summary
lines << SEPARATOR
lines << "ๆคๅบ: #{summary[:total]}ไปถ (DANGER: #{summary[:danger]}, WARNING: #{summary[:warning]}, INFO: #{summary[:info]})"
lines.join("\n")
end
|