Class: SecureKeys::Validation::Actions::Scan
- Inherits:
-
Object
- Object
- SecureKeys::Validation::Actions::Scan
- Defined in:
- lib/validation/actions/scan.rb
Overview
Executes the ‘validate scan` action: runs the scanner, prints a formatted report to the console, optionally saves a JSON report, and exits with an appropriate code (0 = clean, 1 = findings present).
Instance Method Summary collapse
-
#run ⇒ void
Run the scan, print the report, and exit.
Instance Method Details
#run ⇒ void
This method returns an undefined value.
Run the scan, print the report, and exit
17 18 19 20 21 22 |
# File 'lib/validation/actions/scan.rb', line 17 def run result = execute_scan print_result(result:) save_report(result:) if Console::Argument::Scan::Handler.fetch(key: :output) exit(result.clean? ? 0 : 1) end |