Module: Package::Audit::Util::SummaryPrinter

Defined in:
lib/package/audit/util/summary_printer.rb

Class Method Summary collapse

Class Method Details

.allObject



8
9
10
11
12
# File 'lib/package/audit/util/summary_printer.rb', line 8

def self.all
  printf(" %<info>s\n %<cmd>s\n",
         info: Util::BashColor.blue('To show how risk is calculated run:'),
         cmd: Util::BashColor.magenta(' > package-audit risk'))
end

.deprecatedObject



14
15
16
17
18
19
# File 'lib/package/audit/util/summary_printer.rb', line 14

def self.deprecated
  puts " #{Util::BashColor.blue('Although the packages above have no recent updates, ' \
                                'they may not be deprecated.')}"
  puts " #{Util::BashColor.blue('Please contact the package author for more information about its status.')}"
  puts
end

.statistics(format, technology, report, pkgs, ignored_pkgs) ⇒ Object



39
40
41
42
# File 'lib/package/audit/util/summary_printer.rb', line 39

def self.statistics(format, technology, report, pkgs, ignored_pkgs)
  stats = calculate_statistics(pkgs, ignored_pkgs)
  display_results(format, technology, report, pkgs, ignored_pkgs, stats)
end

.total(technology, report, pkgs, ignored_pkgs) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/package/audit/util/summary_printer.rb', line 27

def self.total(technology, report, pkgs, ignored_pkgs)
  if ignored_pkgs.any?
    puts " #{Util::BashColor.cyan("Found a total of #{pkgs.length} #{technology.capitalize} packages " \
                                  "(#{ignored_pkgs.length} ignored).")}"
  elsif pkgs.any?
    puts " #{Util::BashColor.cyan("Found a total of #{pkgs.length} #{technology.capitalize} packages.")}"
  else
    puts " #{Util::BashColor.green("There are no #{report} #{technology.capitalize} packages!")}"
  end
  puts
end

.vulnerable(technology, cmd) ⇒ Object



21
22
23
24
25
# File 'lib/package/audit/util/summary_printer.rb', line 21

def self.vulnerable(technology, cmd)
  printf(" %<info>s\n %<cmd>s\n",
         info: Util::BashColor.blue("For more information about #{technology.capitalize} vulnerabilities run:"),
         cmd: Util::BashColor.magenta(" > #{cmd}"))
end