Project

open5

0.02
No commit activity in last 3 years
No release in over 3 years
open5(cmd, *option) #=> stdin, stdout, stderr, thread
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

open5

gem install open5

and

require 'open5'
open5('command', 'opt') {|i, o, e, t|
  i.puts 'input!'
  p o.gets
  Process.kill 'KILL', t.pid
}

or

require 'open5'
i, o, e, t = open5('command', 'opt')

Why open5?

  • open3 doesn't give the pid on ruby 1.8.
  • open4 has different interface to open3 on ruby 1.9.
  • tasks doesn't work on Windows because it uses fork.

open5 works both on ruby 1.8 and 1.9, and supports Windows! (Though I've never tested it on Windows yet.)

Dependency

  • open4

Author

Tatsuhiro Ujihisa