diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-05-14 08:56:50 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-05-14 08:56:50 +0000 |
commit | 7e774e049258dbda55edfdac9c5022c3d8fbdcf1 (patch) | |
tree | 799b161f2f4a602d1a83c0d0dd92f8e77a9b979b /lib | |
parent | e700588c87adca2e9597bd5ec759a4edb4a6ac31 (diff) |
moving
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/telnet.rb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/telnet.rb b/lib/telnet.rb index a84180365b..855a9f5334 100644 --- a/lib/telnet.rb +++ b/lib/telnet.rb @@ -2,8 +2,7 @@ = simple telnet cliant library -telnet.rb ver0.163 1999/04/11 - +telnet.rb ver0.17 1999/04/30 Wakou Aoyama <wakou@fsinet.or.jp> @@ -144,6 +143,10 @@ of cource, set sync=TRUE or flush is necessary. = history +ver0.17 1999/04/30 +bug fix +$! + "\n" --> $!.to_s + "\n" + ver0.163 1999/04/11 STDOUT.write(message) --> yield(message) if iterator? @@ -316,8 +319,8 @@ class Telnet < SimpleDelegator rescue TimeoutError raise TimeOut, "timed-out; opening of the host" rescue - @log.write($! + "\n") if @options.include?("Output_log") - @dumplog.write($! + "\n") if @options.include?("Dump_log") + @log.write($!.to_s + "\n") if @options.include?("Output_log") + @dumplog.write($!.to_s + "\n") if @options.include?("Dump_log") raise end @sock.sync = TRUE @@ -400,11 +403,15 @@ class Telnet < SimpleDelegator waittime = @options["Waittime"] if options.kind_of?(Hash) - prompt = options["Prompt"] if options.include?("Prompt") + prompt = if options.include?("Match") + options["Match"] + elsif options.include?("Prompt") + options["Prompt"] + elsif options.include?("String") + Regexp.new( Regexp.quote(options["String"]) ) + end time_out = options["Timeout"] if options.include?("Timeout") waittime = options["Waittime"] if options.include?("Waittime") - prompt = Regexp.new( Regexp.quote(options["String"]) ) if - options.include?("String") else prompt = options end |