Class: Dmatrix::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/dmatrix/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(options:, run_command:, logger: Logger.new) ⇒ Runner

Returns a new instance of Runner.



11
12
13
14
15
# File 'lib/dmatrix/runner.rb', line 11

def initialize(options:, run_command:, logger: Logger.new)
  @options = options
  @run_command = run_command
  @logger = logger
end

Instance Method Details

#callObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/dmatrix/runner.rb', line 17

def call
  reset_log_dir

  results = Parallel.map(combinations, in_threads: 4) do |combination|
    Executor.new(
      combination: combination,
      run_command: run_command,
      log_dir: log_dir
    ).build_run.tap do |result|
      logger.log_result(result)
    end
  end

  if results.any?(&:failure?)
    exit(1)
  end
end