summaryrefslogtreecommitdiff
path: root/lib/net/telnet.rb
diff options
context:
space:
mode:
authorwakou <wakou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-14 00:26:05 +0000
committerwakou <wakou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-14 00:26:05 +0000
commit652f744cba955435d0c69f17fa42c3c7b88bcbe9 (patch)
tree09a31579caec58362a41c4d02a94f15ee62cc2e8 /lib/net/telnet.rb
parent3e865dceffae6245f9277af11e0422d10b01258c (diff)
wakou
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/telnet.rb')
-rw-r--r--lib/net/telnet.rb46
1 files changed, 25 insertions, 21 deletions
diff --git a/lib/net/telnet.rb b/lib/net/telnet.rb
index 8ff1884..4a0860e 100644
--- a/lib/net/telnet.rb
+++ b/lib/net/telnet.rb
@@ -4,7 +4,7 @@
net/telnet.rb - simple telnet client library
-Version 1.6.0
+Version 1.6.1
Wakou Aoyama <wakou@fsinet.or.jp>
@@ -239,10 +239,10 @@ module Net
CR = "\015"
LF = "\012"
EOL = CR + LF
- VERSION = "1.6.0"
- RELEASE_DATE = "2000-09-12"
- VERSION_CODE = 160
- RELEASE_CODE = 20000912
+ VERSION = "1.6.1"
+ RELEASE_DATE = "2000-12-14"
+ VERSION_CODE = 161
+ RELEASE_CODE = 20001214
def initialize(options)
@options = options
@@ -398,42 +398,42 @@ module Net
[#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}]|
#{SB}[^#{IAC}]*#{IAC}#{SE}
)/xno) do
- if IAC == $1 # handle escaped IAC characters
+ if IAC == Regexp::last_match[1] # handle escaped IAC characters
IAC
- elsif AYT == $1 # respond to "IAC AYT" (are you there)
+ elsif AYT == Regexp::last_match[1] # respond to "IAC AYT" (are you there)
self.write("nobody here but us pigeons" + EOL)
''
- elsif DO[0] == $1[0] # respond to "IAC DO x"
- if OPT_BINARY[0] == $1[1]
+ elsif DO[0] == Regexp::last_match[1][0] # respond to "IAC DO x"
+ if OPT_BINARY[0] == Regexp::last_match[1][1]
@telnet_option["BINARY"] = true
self.write(IAC + WILL + OPT_BINARY)
else
- self.write(IAC + WONT + $1[1..1])
+ self.write(IAC + WONT + Regexp::last_match[1][1..1])
end
''
- elsif DONT[0] == $1[0] # respond to "IAC DON'T x" with "IAC WON'T x"
- self.write(IAC + WONT + $1[1..1])
+ elsif DONT[0] == Regexp::last_match[1][0] # respond to "IAC DON'T x" with "IAC WON'T x"
+ self.write(IAC + WONT + Regexp::last_match[1][1..1])
''
- elsif WILL[0] == $1[0] # respond to "IAC WILL x"
- if OPT_BINARY[0] == $1[1]
+ elsif WILL[0] == Regexp::last_match[1][0] # respond to "IAC WILL x"
+ if OPT_BINARY[0] == Regexp::last_match[1][1]
self.write(IAC + DO + OPT_BINARY)
- elsif OPT_ECHO[0] == $1[1]
+ elsif OPT_ECHO[0] == Regexp::last_match[1][1]
self.write(IAC + DO + OPT_ECHO)
- elsif OPT_SGA[0] == $1[1]
+ elsif OPT_SGA[0] == Regexp::last_match[1][1]
@telnet_option["SGA"] = true
self.write(IAC + DO + OPT_SGA)
else
- self.write(IAC + DONT + $1[1..1])
+ self.write(IAC + DONT + Regexp::last_match[1][1..1])
end
''
- elsif WONT[0] == $1[0] # respond to "IAC WON'T x"
- if OPT_ECHO[0] == $1[1]
+ elsif WONT[0] == Regexp::last_match[1][0] # respond to "IAC WON'T x"
+ if OPT_ECHO[0] == Regexp::last_match[1][1]
self.write(IAC + DONT + OPT_ECHO)
- elsif OPT_SGA[0] == $1[1]
+ elsif OPT_SGA[0] == Regexp::last_match[1][1]
@telnet_option["SGA"] = false
self.write(IAC + DONT + OPT_SGA)
else
- self.write(IAC + DONT + $1[1..1])
+ self.write(IAC + DONT + Regexp::last_match[1][1..1])
end
''
else
@@ -599,6 +599,10 @@ end
== HISTORY
+* Mon Dec 11 00:16:51 JST 2000 - wakou
+ * version 1.6.1
+ * $1 --> Regexp::last_match[1]
+
* 2000/09/12 05:37:35 - matz
* change: iterator? --> block_given?