diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-08 15:34:15 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-08 15:34:15 +0000 |
commit | c2c679bc385f8d1067e218a3c96de570daa48117 (patch) | |
tree | 965aa62ed21f0e4c50e3ee3b6921a3576a06f02f /lib/net/telnet.rb | |
parent | 98bcdc60ab88542e9e473d0310ad0220ae760924 (diff) | |
download | ruby-c2c679bc385f8d1067e218a3c96de570daa48117.tar.gz |
* lib/net/telnet.rb (cmd): Pass FailEOF options: patch by Brian Candler [ruby-core:22723]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/telnet.rb')
-rw-r--r-- | lib/net/telnet.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/net/telnet.rb b/lib/net/telnet.rb index 98285a944b..17eec1f5e2 100644 --- a/lib/net/telnet.rb +++ b/lib/net/telnet.rb @@ -681,20 +681,22 @@ module Net 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 |