Class: LayerChecker::Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/layer_checker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#analyzerObject (readonly)

Returns the value of attribute analyzer.



17
18
19
# File 'lib/layer_checker.rb', line 17

def analyzer
  @analyzer
end

#configObject (readonly)

Returns the value of attribute config.



17
18
19
# File 'lib/layer_checker.rb', line 17

def config
  @config
end

#validatorObject (readonly)

Returns the value of attribute validator.



17
18
19
# File 'lib/layer_checker.rb', line 17

def validator
  @validator
end

#violationsObject (readonly)

Returns the value of attribute violations.



17
18
19
# File 'lib/layer_checker.rb', line 17

def violations
  @violations
end

Instance Method Details

#checkObject



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