summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-08 15:34:15 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-08 15:34:15 +0000
commite125cea12932fe97bee4d79c3a04151f4380f398 (patch)
tree965aa62ed21f0e4c50e3ee3b6921a3576a06f02f
parent4138adfca702bffd9232746803bca213ec7f2902 (diff)
downloadruby-e125cea12932fe97bee4d79c3a04151f4380f398.tar.gz
ruby-e125cea12932fe97bee4d79c3a04151f4380f398.tar.xz
ruby-e125cea12932fe97bee4d79c3a04151f4380f398.zip
* lib/net/telnet.rb (cmd): Pass FailEOF options: patch by Brian Candler [ruby-core:22723]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25263 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 d76e9a42b..a03a1434d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Oct 9 00:33:29 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/net/telnet.rb (cmd): Pass FailEOF options: patch by Brian
+ Candler [ruby-core:22723]
+
Fri Oct 9 00:01:17 2009 Tanaka Akira <akr@fsij.org>
* ext/socket/lib/socket.rb (Socket.udp_server_recv): extracted from
diff --git a/lib/net/telnet.rb b/lib/net/telnet.rb
index 98285a944..17eec1f5e 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