Class: SimpleStdoutResults
- Inherits:
-
Object
- Object
- SimpleStdoutResults
- Defined in:
- lib/cfn-nag/result_view/simple_stdout_results.rb
Overview
Print results to STDOUT
Instance Method Summary collapse
- #message_violations(violations) ⇒ Object
- #print_failures(violations) ⇒ Object
- #print_warnings(violations) ⇒ Object
- #render(results) ⇒ Object
Instance Method Details
#message_violations(violations) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/cfn-nag/result_view/simple_stdout_results.rb', line 8 def (violations) violations.each do |violation| color = violation.type == 'FAIL' ? :red : :yellow message_type: "#{violation.type} #{violation.id}", color: color, message: violation., logical_resource_ids: violation.logical_resource_ids, line_numbers: violation.line_numbers end end |
#print_failures(violations) ⇒ Object
20 21 22 |
# File 'lib/cfn-nag/result_view/simple_stdout_results.rb', line 20 def print_failures(violations) puts "\nFailures count: #{Violation.count_failures(violations)}" end |
#print_warnings(violations) ⇒ Object
24 25 26 |
# File 'lib/cfn-nag/result_view/simple_stdout_results.rb', line 24 def print_warnings(violations) puts "Warnings count: #{Violation.count_warnings(violations)}" end |
#render(results) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/cfn-nag/result_view/simple_stdout_results.rb', line 28 def render(results) results.each do |result| 60.times { print '-' } puts "\n" + result[:filename] 60.times { print '-' } violations = result[:file_results][:violations] violations print_failures violations print_warnings violations end end |