summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-08 15:34:51 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-08 15:34:51 +0000
commit4432d3a5221d5929cea021cad3e9b85cdad10d21 (patch)
tree22e0477b83466b1064e4ff74a596baab96a52c1d
parentb661aa0cc84fdb9821b1beee6424967d288259af (diff)
* 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_8@25264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/net/telnet.rb6
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6168d59480..1d51f48b9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Oct 9 00:34:20 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * 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@fsij.org>
* time.c (NUM2TIMET): defined because some platforms, such as
diff --git a/lib/net/telnet.rb b/lib/net/telnet.rb
index 73471c3327..91628a8e84 100644
--- a/lib/net/telnet.rb
+++ b/lib/net/telnet.rb
@@ -678,20 +678,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