Hi
In the version of Ruby 1.8.7 this code works as expected
require 'rubygems'
require 'net/telnet'
$localhost = Net::Telnet.new("Host"=>"appfoca04") {|str| puts str}
$localhost.waitfor(/Connected/ ) { |response| print "Response 4
connection: " + response }
but in 1.9.1 I get the following error:
telnet.rb:5:in `<main>': undefined method `waitfor' for
#<TCPSocket:0x1efa0a0> (NoMethodError)
Any idea?
Greetings,
Gaspar Brogueira
···
--
Posted via http://www.ruby-forum.com/.
Try 1.9.2. Worked fine for me there (with a different host, of course).
-Justin
···
On 03/01/2011 07:01 AM, Gaspar Brogueira wrote:
Hi
In the version of Ruby 1.8.7 this code works as expected
require 'rubygems'
require 'net/telnet'
$localhost = Net::Telnet.new("Host"=>"appfoca04") {|str| puts str}
$localhost.waitfor(/Connected/ ) { |response| print "Response 4
connection: " + response }
but in 1.9.1 I get the following error:
telnet.rb:5:in `<main>': undefined method `waitfor' for
#<TCPSocket:0x1efa0a0> (NoMethodError)
Any idea?
Greetings,
Gaspar Brogueira