class Spellr::CheckParallel

Public Instance Methods

check() click to toggle source
# 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