S
stevarino
Ruby newbie, need help with expect.rb.
I am running:
ruby 1.8.4 (2005-12-24) [sparc-solaris2.7]
(downloaded from SunFreeware.com).
When I run:
ruby expect_sample.rb
it aborts with the following error message:
/usr/local/lib/ruby/1.8/expect.rb:17: `undefined method `chr' for
nil:NilClass' (NoMethodError)
Looking at expect.rb, the relevant code is:
while true
if IO.select([self],nil,nil,timeout).nil? then
result = nil
break
end
c = getc.chr # line 17
...
end
Questions:
- It appears to me that getc is returning 'nil', which doesn't support
the 'chr' method.
but shouldn't the 'select().nil?' test prevent this?
- I assume expect.rb does not throw this error for everybody else --
any suggestions?
TIA,
Steve
I am running:
ruby 1.8.4 (2005-12-24) [sparc-solaris2.7]
(downloaded from SunFreeware.com).
When I run:
ruby expect_sample.rb
it aborts with the following error message:
/usr/local/lib/ruby/1.8/expect.rb:17: `undefined method `chr' for
nil:NilClass' (NoMethodError)
Looking at expect.rb, the relevant code is:
while true
if IO.select([self],nil,nil,timeout).nil? then
result = nil
break
end
c = getc.chr # line 17
...
end
Questions:
- It appears to me that getc is returning 'nil', which doesn't support
the 'chr' method.
but shouldn't the 'select().nil?' test prevent this?
- I assume expect.rb does not throw this error for everybody else --
any suggestions?
TIA,
Steve