ruby-changes:13489
From: marcandre <ko1@a...>
Date: Fri, 9 Oct 2009 00:35:02 +0900 (JST)
Subject: [ruby-changes:13489] Ruby:r25264 (ruby_1_8): * lib/net/telnet.rb (cmd): Pass FailEOF options: patch by Brian Candler
marcandre 2009-10-09 00:34:51 +0900 (Fri, 09 Oct 2009) New Revision: 25264 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25264 Log: * lib/net/telnet.rb (cmd): Pass FailEOF options: patch by Brian Candler [ruby-core:22723] Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/lib/net/telnet.rb Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 25263) +++ ruby_1_8/ChangeLog (revision 25264) @@ -1,3 +1,8 @@ +Fri Oct 9 00:34:20 2009 Marc-Andre Lafortune <ruby-core@m...> + + * lib/net/telnet.rb (cmd): Pass FailEOF options: patch by Brian + Candler [ruby-core:22723] + Wed Oct 7 08:07:45 2009 Tanaka Akira <akr@f...> * time.c (NUM2TIMET): defined because some platforms, such as Index: ruby_1_8/lib/net/telnet.rb =================================================================== --- ruby_1_8/lib/net/telnet.rb (revision 25263) +++ ruby_1_8/lib/net/telnet.rb (revision 25264) @@ -678,20 +678,22 @@ def cmd(options) # :yield: recvdata match = @options["Prompt"] time_out = @options["Timeout"] + fail_eof = @options["FailEOF"] if options.kind_of?(Hash) string = options["String"] match = options["Match"] if options.has_key?("Match") time_out = options["Timeout"] if options.has_key?("Timeout") + fail_eof = options["FailEOF"] if options.has_key?("FailEOF") else string = options end self.puts(string) if block_given? - waitfor({"Prompt" => match, "Timeout" => time_out}){|c| yield c } + waitfor({"Prompt" => match, "Timeout" => time_out, "FailEOF" => fail_eof}){|c| yield c } else - waitfor({"Prompt" => match, "Timeout" => time_out}) + waitfor({"Prompt" => match, "Timeout" => time_out, "FailEOF" => fail_eof}) end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/