From: Jeremy McAnally Date: 2008-10-31T01:43:51+09:00 Subject: Re: Using Expect in Ruby I believe Hal Fulton has either ported Expect to Ruby or has a nice binding in Ruby for it. I'm not sure if he reads this list or not, and if I didn't see a response here in a few days, I'd just ping him from his website. He mentioned at the SCRubyConf in his talk. I'm not sure when those videos will be up, but he showed some examples and such. --Jeremy On Thu, Oct 30, 2008 at 11:34 AM, stephan.zimmer wrote: > I'm using Expect inside of a ruby script to control an external > program. So far I have only used libexpect from a C program and would > have several questions regarding the Ruby interface of Expect, maybe > someone already experienced using it: > > After having processed the output of the external program that I'm > interested in I would like to empty the expect buffer by expecting an > EOF marker. In an expect script this can be done by "expect eof > { doSomething }". Does anyone know how this can be done in Ruby? > > How can I know whether the external program has already finished? > > How to handle several different cases inside of an expect statement: > expect { > timeout { doAction1 } > eof { doAction2 } > ... > } > > Is there any documentation for the ruby interface? > > I would also be very grateful for partial answers and/or any related > information. > > Thanks in advance, > > Stephan > > -- http://jeremymcanally.com/ http://entp.com/ http://omgbloglol.com My books: http://manning.com/mcanally/ http://humblelittlerubybook.com/ (FREE!)