Class: Templatecop::Runner
- Inherits:
-
Object
- Object
- Templatecop::Runner
- Defined in:
- lib/templatecop/runner.rb
Overview
Run investigation and auto-correction.
Instance Method Summary collapse
- #call ⇒ Array<RuboCop::Cop::Offense>
-
#initialize(autocorrect:, file_paths:, formatter:, rubocop_config:, ruby_extractor:, debug: false) ⇒ Runner
constructor
A new instance of Runner.
Constructor Details
#initialize(autocorrect:, file_paths:, formatter:, rubocop_config:, ruby_extractor:, debug: false) ⇒ Runner
Returns a new instance of Runner.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/templatecop/runner.rb', line 15 def initialize( autocorrect:, file_paths:, formatter:, rubocop_config:, ruby_extractor:, debug: false ) @autocorrect = autocorrect @debug = debug @file_paths = file_paths @formatter = formatter @rubocop_config = rubocop_config @ruby_extractor = ruby_extractor end |
Instance Method Details
#call ⇒ Array<RuboCop::Cop::Offense>
32 33 34 35 36 37 38 39 |
# File 'lib/templatecop/runner.rb', line 32 def call on_started result = run_in_parallel on_finished(result) result.flat_map do |(_, offenses)| offenses end end |