Class: Rwm::ConventionChecker

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

Instance Method Summary collapse

Constructor Details

#initialize(graph) ⇒ ConventionChecker

Returns a new instance of ConventionChecker.



5
6
7
# File 'lib/rwm/convention_checker.rb', line 5

def initialize(graph)
  @graph = graph
end

Instance Method Details

#checkObject



20
21
22
23
24
25
# File 'lib/rwm/convention_checker.rb', line 20

def check
  check!
  []
rescue ConventionError => e
  e.violations
end

#check!Object

Raises:



9
10
11
12
13
14
15
16
17
18
# File 'lib/rwm/convention_checker.rb', line 9

def check!
  violations = []
  violations.concat(check_no_lib_depends_on_app)
  violations.concat(check_no_app_depends_on_app)
  violations.concat(check_no_cycles)

  raise ConventionError, violations unless violations.empty?

  true
end