diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-05-02 15:19:20 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-05-02 15:19:20 +0000 |
commit | e221d6826a67e6e2fc3e12303e4e070452069b2e (patch) | |
tree | c5170f5fa68888ff79fdda063d1f3ac9121029b9 /lib/net | |
parent | e3056c880364f5cb79eb9280b4d34b34c3eb4f93 (diff) | |
download | ruby-e221d6826a67e6e2fc3e12303e4e070452069b2e.tar.gz |
* lib/net/protocol.rb: reintroduce Protocol.protocol_param.
* lib/net/http.rb: ditto.
* lib/net/pop.rb: ditto.
* lib/net/smtp.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/http.rb | 2 | ||||
-rw-r--r-- | lib/net/pop.rb | 2 | ||||
-rw-r--r-- | lib/net/protocol.rb | 11 | ||||
-rw-r--r-- | lib/net/smtp.rb | 2 |
4 files changed, 14 insertions, 3 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index a88e69c0bb..e074dd978e 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -562,7 +562,7 @@ module Net class HTTPHeaderSyntaxError < StandardError; end - class HTTP + class HTTP < Protocol Revision = %q$Revision$.split[1] diff --git a/lib/net/pop.rb b/lib/net/pop.rb index 9259750bb0..fa012f1a3a 100644 --- a/lib/net/pop.rb +++ b/lib/net/pop.rb @@ -401,7 +401,7 @@ module Net class POPBadResponse < StandardError; end - class POP3 + class POP3 < Protocol Revision = %q$Revision$.split[1] diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb index fd85771dd5..c4dcce9e44 100644 --- a/lib/net/protocol.rb +++ b/lib/net/protocol.rb @@ -24,6 +24,17 @@ require 'timeout' module Net + class Protocol + private + def Protocol.protocol_param( name, val ) + module_eval(<<-End, __FILE__, __LINE__ + 1) + def #{name} + #{val} + end + End + end + end + class ProtocolError < StandardError; end class ProtoSyntaxError < ProtocolError; end class ProtoFatalError < ProtocolError; end diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb index b963204160..276c979b20 100644 --- a/lib/net/smtp.rb +++ b/lib/net/smtp.rb @@ -233,7 +233,7 @@ require 'digest/md5' module Net - class SMTP + class SMTP < Protocol Revision = %q$Revision$.split[1] |