class EnginePack::CommandRunner
Attributes
io[R]
Public Class Methods
new(io: Open3)
click to toggle source
# File lib/engine_pack/command_runner.rb, line 3 def initialize(io: Open3) @io = io end
Public Instance Methods
run(cmd, environment_variables = {})
click to toggle source
# File lib/engine_pack/command_runner.rb, line 7 def run(cmd, environment_variables = {}) io.popen3( environment_variables, "#{cmd} 2>&1" ) do |stdin, stdout, _stderr, wait_thread| stdin.close_write while line = stdout.gets puts line end puts wait_thread.value end end