Module: TestProf::Autopilot::CommandExecutor

Defined in:
lib/test_prof/autopilot/command_executor.rb

Overview

Module is used for commands execution in child process.

Class Method Summary collapse

Class Method Details

.execute(env, command) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/test_prof/autopilot/command_executor.rb', line 9

def execute(env, command)
  env.merge!("TEST_PROF_AUTOPILOT_ENABLED" => "true")

  Open3.popen2e(env, command) do |_stdin, stdout_and_stderr, _wait_thr|
    while (line = stdout_and_stderr.gets)
      Logging.log line
    end
  end
end