Class: Spellr::CheckParallel

Inherits:
Check
  • Object
show all
Defined in:
lib/spellr/check_parallel.rb

Instance Attribute Summary

Attributes inherited from Check

#files, #reporter

Instance Method Summary collapse

Methods inherited from Check

#exit_code, #initialize

Methods included from StringFormat

aqua, bold, green, key, lighten, normal, pluralize, red

Constructor Details

This class inherits a constructor from Spellr::Check

Instance Method Details

#checkObject

rubocop:disable Metrics/MethodLength



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/spellr/check_parallel.rb', line 10

def check # rubocop:disable Metrics/MethodLength
  acc_reporter = @reporter

  Parallel.each(files, finish: ->(_, _, result) { acc_reporter.output << result }) do |file|
    @reporter = acc_reporter.class.new(Spellr::OutputStubbed.new)
    check_and_count_file(file)
    reporter.output
  end
  @reporter = acc_reporter

  reporter.finish
end