2010/3/8 James Coglan <jcoglan / googlemail.com>:

> If I run an external process, e.g.
>
> IO.popen('cucumber')
>
> Then Ruby blocks while waiting for the whole output of the subprocess.

IO.popen does not block anything.  You would at least have to read
from or write to the stream in order to get a chance of blocking.

> Is
> there a way to read the subprocess' output incrementally as it is being
> written?

You can use IO#read(int), i.e. with a size limit, or you can read line
based.  What code do you have and what do you want to accomplish?

Kind regards

robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/