lib/hrw/formatter.rb in hrw-0.3.5 vs lib/hrw/formatter.rb in hrw-0.3.6
- old
+ new
@@ -51,11 +51,11 @@
deps = filter(result)
deps.each do |dep|
dep['vulnerabilities'].each do |vuln|
# TODO: bad smell here
begin
- patched_version = JSON.parse(vuln['fixed_by'])
+ patched_version = JSON.parse(vuln['fixed_by'])['spec'].join(', ')
rescue JSON::ParserError
patched_version = vuln['fixed_by']
end
case vuln['severity']
@@ -73,23 +73,23 @@
low += 1
end
pkg = "#{dep['name']}@#{dep['version']}"
puts "✗ #{vuln['severity']} severity vulnerability found in #{pkg.underline.bright}".foreground(color)
- puts 'Name:'
+ puts 'Name:'.underline
puts " #{vuln['name']}"
puts
- puts 'Description:'
+ puts 'Description:'.underline
puts vuln['description'].gsub(/^/, ' ')
puts
- puts 'Severity:'
+ puts 'Severity:'.underline
puts " #{vuln['severity']}"
puts
- puts 'Link:'
+ puts 'Link:'.underline
puts " #{vuln['link']}"
puts
- puts 'Patched version:'
- puts " #{patched_version['spec'].join(', ')}"
+ puts 'Patched version:'.underline
+ puts " #{patched_version}"
puts
puts
end
end
\ No newline at end of file