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`.

Constant Summary collapse

CHECKERS =
{
  abc:       AbcCheck,
  style:     StyleCheck,
  doc:       DocCheck,
  threshold: ThresholdCheck
}

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Runner

Returns a new instance of Runner.



24
25
26
# File 'lib/cane.rb', line 24

def initialize(opts)
  @opts = opts
end

Instance Method Details

#runObject



28
29
30
31
32
# File 'lib/cane.rb', line 28

def run
  outputter.print ViolationFormatter.new(violations)

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