# frozen_string_literal: true require 'childprocess' module NoradBeacon class MultiRunner < Runner attr_reader :result_sets # Initialize an instance of the MultiRunner class # # @param prog [String] the program to execute # @param args [Array] list of arguments to pass to the program # @param timeout [Fixnum] optionally specify the timeout for the sub process # @return [NoradBeacon::Runner] an instance of the Runner class def initialize(prog, args, timeout = 600) raise ArgumentError, 'args must be an Array' unless args.is_a?(Array) @prog = prog @timeout = timeout @results_file = "/tmp/#{@prog}.#{Time.now.strftime('%Y%m%d-%H%M%S')}" @result_sets = [] @args = format_args(args) end end end