summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-30 12:44:58 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-30 12:44:58 +0000
commit3efa5181dc7f2226daf2bc0d09ae1e73cd3a7601 (patch)
tree17b2fe3c1f43a2406da8e5b795f31334a95996b4 /lib
parent3e23ba599d8c7787195333a5605de56df4c21b96 (diff)
merges r25263 from trunk into ruby_1_9_1.
-- * 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/branches/ruby_1_9_1@26475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/telnet.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/net/telnet.rb b/lib/net/telnet.rb
index 67fd656c63..47587c7122 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