Class: SecurityReport::CLI
- Inherits:
-
Object
- Object
- SecurityReport::CLI
- Defined in:
- lib/security_report/cli.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
Returns the value of attribute format.
Instance Method Summary collapse
- #help ⇒ Object
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #reporter ⇒ Object
- #run(files) ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
7 8 9 |
# File 'lib/security_report/cli.rb', line 7 def initialize @format = "plain" end |
Instance Attribute Details
#format ⇒ Object
Returns the value of attribute format.
5 6 7 |
# File 'lib/security_report/cli.rb', line 5 def format @format end |
Instance Method Details
#help ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/security_report/cli.rb', line 11 def help puts <<~HELPTEXT security_report [options] files... -h, --help Print this message --format Provide the format: plain or table (default: plain) --update Update the vulnerability database before running HELPTEXT exit end |
#reporter ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/security_report/cli.rb', line 25 def reporter case format when "plain" require 'security_report/plain_reporter' @reporter = PlainReporter.new when "table" require 'security_report/table_reporter' @reporter = TableReporter.new else puts "Unknown format '#{format}'" exit 1 end end |