Class: Dragnet::CLI::Master
Overview
Entry point class for the Dragnet CLI. Includes all the commands and sub-commands of the CLI.
The class should not contain any logic, everything should be delegated to helper classes as soon as possible. Only exceptions are error handling and message printing.
Constant Summary collapse
- E_MISSING_PARAMETER_ERROR =
2
- E_NO_MTR_FILES_FOUND =
3
- E_GIT_ERROR =
4
- E_EXPORT_ERROR =
5
- E_INCOMPATIBLE_REPOSITORY =
6
- E_ERRORS_DETECTED =
16
- E_FAILED_TESTS =
32
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Dragnet::CLI::Base
Instance Method Details
#check(path = nil) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/dragnet/cli/master.rb', line 60 def check(path = nil) load_configuration self.path = path files = explore test_records, errors = validate(files) verify(test_records) export(test_records, errors) if [:export] exit_code = 0 exit_code |= E_ERRORS_DETECTED if errors.any? exit_code |= E_FAILED_TESTS unless test_records.all? { |test_record| test_record.verification_result.passed? } exit(exit_code) if exit_code.positive? # doing exit(0) will stop RSpec execution. end |