Open3 grants you access to stdin, stdout, stderr and a thread to wait the child process when running another program.
Example:
require "open3" include Open3 stdin, stdout, stderr, wait_thr = popen3('nroff -man')
Open3.popen3 can also take a block which will receive stdin, stdout, stderr and wait_thr as parameters. This ensures stdin, stdout and stderr are closed and the process is terminated once the block exits.
Example:
require "open3" Open3.popen3('nroff -man') { |stdin, stdout, stderr, wait_thr| ... }