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 28 29 30 31 |
# File 'lib/reviewer/doctor/config_check.rb', line 20 def check config_file = @configuration.file unless config_file.exist? report.add(:configuration, status: :error, message: 'No .reviewer.yml found', detail: 'Run `rvw init` to generate one') return end report.add(:configuration, status: :ok, message: '.reviewer.yml found') validate_via_loader end |