Class: LayerChecker::Checker
- Inherits:
-
Object
- Object
- LayerChecker::Checker
- Defined in:
- lib/layer_checker.rb
Instance Attribute Summary collapse
-
#analyzer ⇒ Object
readonly
Returns the value of attribute analyzer.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#validator ⇒ Object
readonly
Returns the value of attribute validator.
-
#violations ⇒ Object
readonly
Returns the value of attribute violations.
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(config_path: 'project_layers.yml', project_root: Dir.pwd) ⇒ Checker
constructor
A new instance of Checker.
- #report(format: :console) ⇒ Object
Constructor Details
#initialize(config_path: 'project_layers.yml', project_root: Dir.pwd) ⇒ Checker
Returns a new instance of Checker.
19 20 21 22 23 24 25 26 |
# File 'lib/layer_checker.rb', line 19 def initialize(config_path: 'project_layers.yml', project_root: Dir.pwd) @config_path = config_path @project_root = project_root @config = nil @analyzer = nil @validator = nil @violations = [] end |
Instance Attribute Details
#analyzer ⇒ Object (readonly)
Returns the value of attribute analyzer.
17 18 19 |
# File 'lib/layer_checker.rb', line 17 def analyzer @analyzer end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
17 18 19 |
# File 'lib/layer_checker.rb', line 17 def config @config end |
#validator ⇒ Object (readonly)
Returns the value of attribute validator.
17 18 19 |
# File 'lib/layer_checker.rb', line 17 def validator @validator end |
#violations ⇒ Object (readonly)
Returns the value of attribute violations.
17 18 19 |
# File 'lib/layer_checker.rb', line 17 def violations @violations end |
Instance Method Details
#check ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/layer_checker.rb', line 28 def check load_configuration analyze_code validate_dependencies build_result end |
#report(format: :console) ⇒ Object
36 37 38 39 40 |
# File 'lib/layer_checker.rb', line 36 def report(format: :console) result = build_result Reporter.report(result, format: format) result end |