diff options
author | wakou <wakou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-12-26 17:48:29 +0000 |
---|---|---|
committer | wakou <wakou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-12-26 17:48:29 +0000 |
commit | 2c5e792dd24afd0fbb30491de2e63e2c0f423be5 (patch) | |
tree | 4fbcaef60206182fd5265f23fe531777c798743c /lib/net | |
parent | 564b20a38e62c5e970bda2627804035a893fd964 (diff) | |
download | ruby-2c5e792dd24afd0fbb30491de2e63e2c0f423be5.tar.gz |
* lib/net/telnet.rb: Telnet#print not add "\n".
* lib/cgi.rb: cgi['key'] is equal cgi['key'][0]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/telnet.rb | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/net/telnet.rb b/lib/net/telnet.rb index 62a8246d11..b03cbc7a73 100644 --- a/lib/net/telnet.rb +++ b/lib/net/telnet.rb @@ -4,7 +4,7 @@ net/telnet.rb - simple telnet client library -Wakou Aoyama <wakou@fsinet.or.jp> +Wakou Aoyama <wakou@ruby-lang.org> === MAKE NEW TELNET OBJECT @@ -90,7 +90,7 @@ of cource, set sync=true or flush is necessary. Telnet#puts() adds "\n" to the last of "string". -WARNING: Telnet#print() NOT adds "\n" to the last of "string", in the future. +CAUTION: Telnet#print() NOT adds "\n" to the last of "string". If "Telnetmode" option is true, then escape IAC code ("\xFF"). If "Binmode" option is false, then convert "\n" to EOL(end of line) code. @@ -504,7 +504,7 @@ module Net end end - def _print(string) + def print(string) string = string.gsub(/#{IAC}/no, IAC + IAC) if @options["Telnetmode"] if @options["Binmode"] @@ -524,15 +524,7 @@ module Net end def puts(string) - self._print(string + "\n") - end - - def print(string) - if $VERBOSE - $stderr.puts 'WARNING: Telnet#print("string") NOT adds "\n" to the last of "string", in the future.' - $stderr.puts ' cf. Telnet#puts().' - end - self.puts(string) + self.print(string + "\n") end def cmd(options) |