From: Theodore Knab Date: 2004-02-11T13:46:51+09:00 Subject: Re: expect.rb I found some example expect code for Ruby now I just need to find the library: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/30822 http://rubystuff.org/treasures/RubyTreasures-0.4/test/test_expect.rb http://www.ksky.ne.jp/~sakae/d2/20518.html http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/35746 On 11/02/04 13:37 +0900, Theodore Knab wrote: > Does anybody know where I can get the expect.rb ? > > As defined, here in Japanese: > http://www.ruby-lang.org/ja/man/index.cgi?cmd=view;name=expect.rb > > See the ab-lib translation below: > > ######################################################## > #ab-lib Translated Japanese > ######################################################## > > The Expect Library is tlc's Expect package. In Ruby it is part of the IO class. > > Example usage: > IO#expect(pattern, timeout=99999) > > With the expect method you can directly interact with inline text > interfaces. Expect uses string patterns and Regexp to read the input > from device. > > One example, of a piece of equipment where Expect could be > used might be a router with either ssh or telnet enabled. Expect can be > called in a Ruby program to process the inline text on the host device. > > When an expected pattern is found, a response will be sent. If the > pattern does not appear, the timeout will expire and move to the next > statement. Practically, Expect has been used to reset passwords on routers. > Expect has been used to run nightly updates on telephone switches. > Expect has been used to setup HP printers. Additionally, expect can be > used to modify any device with a inline text interface. > > -- > ------------------------------------------ > Ted Knab > Chester, MD 21619 > ------------------------------------------ > 35570707f6274702478656021626f6c6964796f6e602f66602478656 > 02e6164796f6e60237471647560216e6460276c6f62616c60257e696 > 4797e2a0 > -- ------------------------------------------ Ted Knab Chester, MD 21619 ------------------------------------------ 35570707f6274702478656021626f6c6964796f6e602f66602478656 02e6164796f6e60237471647560216e6460276c6f62616c60257e696 4797e2a0