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