class U3dCore::SafePopen
Executes commands using popen2 and takes care of error handling and more Note that the executed program might buffer the output as it isn't run inside a pseudo terminal.
Public Class Methods
spawn(command) { |w, r, value.pid| ... }
click to toggle source
Wraps the Open3.popen2e() call, wait until the process completes.
# File lib/u3d_core/command_runner.rb, line 88 def self.spawn(command, &_block) require 'open3' Open3.popen2e(command) do |r, w, p| yield w, r, p.value.pid # note the inversion r.close w.close p.value.exitstatus end end