Class: MetzScan::Commands::Rules
- Inherits:
-
Object
- Object
- MetzScan::Commands::Rules
- Defined in:
- lib/metz_scan/commands/rules.rb
Constant Summary collapse
- ANSI_RESET =
"\e[0m"- ANSI_BOLD =
"\e[1m"- ANSI_CYAN =
"\e[36m"- ANSI_GREY =
"\e[90m"- USAGE =
"Usage: metz-scan rules [--json]"
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(stdout:, stderr:) ⇒ Rules
constructor
A new instance of Rules.
- #run(argv) ⇒ Object
Constructor Details
#initialize(stdout:, stderr:) ⇒ Rules
Returns a new instance of Rules.
20 21 22 23 |
# File 'lib/metz_scan/commands/rules.rb', line 20 def initialize(stdout:, stderr:) @stdout = stdout @stderr = stderr end |
Class Method Details
.run(argv, stdout:, stderr:) ⇒ Object
16 17 18 |
# File 'lib/metz_scan/commands/rules.rb', line 16 def self.run(argv, stdout:, stderr:) new(stdout: stdout, stderr: stderr).run(argv) end |
Instance Method Details
#run(argv) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/metz_scan/commands/rules.rb', line 25 def run(argv) = (argv) cops = load_cops [:json] ? emit_json(cops) : emit_table(cops) 0 end |