Module: Bundler::Audit::CLI::Formats::Text
- Defined in:
- lib/bundler/audit/cli/formats/text.rb
Overview
The plain-text output format.
Instance Method Summary collapse
-
#print_report(report, output = $stdout) ⇒ Object
Prints any findings as plain-text.
Instance Method Details
#print_report(report, output = $stdout) ⇒ Object
Prints any findings as plain-text.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/bundler/audit/cli/formats/text.rb', line 37 def print_report(report,output=$stdout) original_stdout = $stdout $stdout = output report.each do |result| case result when Results::InsecureSource print_warning "Insecure Source URI found: #{result.source}" when Results::UnpatchedGem print_advisory result.gem, result.advisory end end if report.vulnerable? say "Vulnerabilities found!", :red else say("No vulnerabilities found", :green) unless .quiet? end $stdout = original_stdout end |