Class: Reviewer::Doctor::ConfigCheck
- Inherits:
-
Object
- Object
- Reviewer::Doctor::ConfigCheck
- Defined in:
- lib/reviewer/doctor/config_check.rb
Overview
Validates the configuration file by delegating to Configuration::Loader
Instance Attribute Summary collapse
-
#report ⇒ Object
readonly
Returns the value of attribute report.
Instance Method Summary collapse
-
#check ⇒ Object
Checks for .reviewer.yml existence and validity.
-
#initialize(report, configuration:) ⇒ ConfigCheck
constructor
Creates a config check that validates the .reviewer.yml file.
Constructor Details
#initialize(report, configuration:) ⇒ ConfigCheck
Creates a config check that validates the .reviewer.yml file
14 15 16 17 |
# File 'lib/reviewer/doctor/config_check.rb', line 14 def initialize(report, configuration:) @report = report @configuration = configuration end |
Instance Attribute Details
#report ⇒ Object (readonly)
Returns the value of attribute report.
7 8 9 |
# File 'lib/reviewer/doctor/config_check.rb', line 7 def report @report end |
Instance Method Details
#check ⇒ Object
Checks for .reviewer.yml existence and validity
20 21 22 23 24 25 26 27 |
# File 'lib/reviewer/doctor/config_check.rb', line 20 def check config_file = @configuration.file report.set_configuration(path: configuration_path(config_file), state: :missing) return :missing unless config_file.exist? validate_via_loader(config_file) end |