Sha256: 9a5ac4dd9786614181bc49de4e728ae27ebecbed00c2d7073adbaac590af0f45
Contents?: true
Size: 342 Bytes
Versions: 35
Compression:
Stored size: 342 Bytes
Contents
require 'yaml' require 'open4' include Open4 stdin = '42' stdout = '' stderr = '' t = bg 'ruby -e"sleep 4; puts ARGF.read"', 0=>stdin, 1=>stdout, 2=>stderr waiter = Thread.new{ y t.pid => t.exitstatus } # t.exitstatus is a blocking call! while((status = t.status)) y "status" => status sleep 1 end waiter.join y "stdout" => stdout
Version data entries
35 entries across 35 versions & 4 rubygems