summaryrefslogtreecommitdiff
path: root/lib/net/telnet.rb
diff options
context:
space:
mode:
authorwakou <wakou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-24 20:20:49 +0000
committerwakou <wakou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-24 20:20:49 +0000
commit8f6673c2d4a7e6ff470b584141c590e4b066f5e2 (patch)
tree7c0998b0409840e576a4875cffcd7705bf472212 /lib/net/telnet.rb
parentb40f3a89e39b1f2150845f32e673998d8693b294 (diff)
wakou
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1074 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 4a0860e..87790c0 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.1
+Version 1.6.2
Wakou Aoyama <wakou@fsinet.or.jp>
@@ -239,10 +239,10 @@ module Net
CR = "\015"
LF = "\012"
EOL = CR + LF
- VERSION = "1.6.1"
- RELEASE_DATE = "2000-12-14"
- VERSION_CODE = 161
- RELEASE_CODE = 20001214
+ VERSION = "1.6.2"
+ RELEASE_DATE = "2000-12-25"
+ VERSION_CODE = 162
+ RELEASE_CODE = 20001225
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 == Regexp::last_match[1] # handle escaped IAC characters
+ if IAC == $1 # handle escaped IAC characters
IAC
- elsif AYT == Regexp::last_match[1] # respond to "IAC AYT" (are you there)
+ elsif AYT == $1 # respond to "IAC AYT" (are you there)
self.write("nobody here but us pigeons" + EOL)
''
- elsif DO[0] == Regexp::last_match[1][0] # respond to "IAC DO x"
- if OPT_BINARY[0] == Regexp::last_match[1][1]
+ elsif DO[0] == $1[0] # respond to "IAC DO x"
+ if OPT_BINARY[0] == $1[1]
@telnet_option["BINARY"] = true
self.write(IAC + WILL + OPT_BINARY)
else
- self.write(IAC + WONT + Regexp::last_match[1][1..1])
+ self.write(IAC + WONT + $1[1..1])
end
''
- 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 DONT[0] == $1[0] # respond to "IAC DON'T x" with "IAC WON'T x"
+ self.write(IAC + WONT + $1[1..1])
''
- elsif WILL[0] == Regexp::last_match[1][0] # respond to "IAC WILL x"
- if OPT_BINARY[0] == Regexp::last_match[1][1]
+ elsif WILL[0] == $1[0] # respond to "IAC WILL x"
+ if OPT_BINARY[0] == $1[1]
self.write(IAC + DO + OPT_BINARY)
- elsif OPT_ECHO[0] == Regexp::last_match[1][1]
+ elsif OPT_ECHO[0] == $1[1]
self.write(IAC + DO + OPT_ECHO)
- elsif OPT_SGA[0] == Regexp::last_match[1][1]
+ elsif OPT_SGA[0] == $1[1]
@telnet_option["SGA"] = true
self.write(IAC + DO + OPT_SGA)
else
- self.write(IAC + DONT + Regexp::last_match[1][1..1])
+ self.write(IAC + DONT + $1[1..1])
end
''
- elsif WONT[0] == Regexp::last_match[1][0] # respond to "IAC WON'T x"
- if OPT_ECHO[0] == Regexp::last_match[1][1]
+ elsif WONT[0] == $1[0] # respond to "IAC WON'T x"
+ if OPT_ECHO[0] == $1[1]
self.write(IAC + DONT + OPT_ECHO)
- elsif OPT_SGA[0] == Regexp::last_match[1][1]
+ elsif OPT_SGA[0] == $1[1]
@telnet_option["SGA"] = false
self.write(IAC + DONT + OPT_SGA)
else
- self.write(IAC + DONT + Regexp::last_match[1][1..1])
+ self.write(IAC + DONT + $1[1..1])
end
''
else
@@ -599,6 +599,10 @@ end
== HISTORY
+* Mon Dec 25 01:37:43 JST 2000 - wakou
+ * version 1.6.2
+ * Regexp::last_match[1] --> $1
+
* Mon Dec 11 00:16:51 JST 2000 - wakou
* version 1.6.1
* $1 --> Regexp::last_match[1]