Sha256: 183ff05fecd6f78ddcd6483b3274b254de12941b1fba90c9765b99e6da818e14
Contents?: true
Size: 566 Bytes
Versions: 10
Compression:
Stored size: 566 Bytes
Contents
require 'parallel' module ParallelSplitTest class << self attr_accessor :example_counter, :processes, :process_number def run_example? self.example_counter += 1 (example_counter - 1) % processes == process_number end def choose_number_of_processes self.processes = best_number_of_processes end def best_number_of_processes [ ENV['PARALLEL_SPLIT_TEST_PROCESSES'], Parallel.physical_processor_count, Parallel.processor_count ].map(&:to_i).find{|number| number > 0 } end end end
Version data entries
10 entries across 10 versions & 1 rubygems