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`.
Instance Method Summary collapse
-
#initialize(spec) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
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
#run ⇒ Object
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 |