Class: Cane::Runner

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

Overview

Orchestrates the running of checks per the provided configuration, and hands the result to a formatter for display. This is the core of the application, but for the actual entry point see ‘Cane::CLI`.

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ Runner

Returns a new instance of Runner.



33
34
35
36
# File 'lib/cane.rb', line 33

def initialize(spec)
  @opts = spec
  @checks = spec[:checks]
end

Instance Method Details

#runObject



38
39
40
41
42
# File 'lib/cane.rb', line 38

def run
  outputter.print ViolationFormatter.new(violations)

  violations.length <= opts.fetch(:max_violations)
end