Class: Cane::Runner
- Inherits:
-
Object
- Object
- Cane::Runner
- 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
-
#initialize(opts) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
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
#run ⇒ Object
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 |