diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-10-18 09:03:16 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-10-18 09:03:16 +0000 |
commit | 125ca1a11a53810ac311012352f5b0773fc2bbde (patch) | |
tree | 2b9ac558373e9742e475be19fed72bfb7924a0f9 /lib | |
parent | 40a3f601e43a137e56b2c28454ffb6ce79d7ec7e (diff) |
19991018
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/pop.rb | 23 | ||||
-rw-r--r-- | lib/net/session.rb | 16 | ||||
-rw-r--r-- | lib/net/smtp.rb | 4 |
3 files changed, 31 insertions, 12 deletions
diff --git a/lib/net/pop.rb b/lib/net/pop.rb index c492a4cd20..547dafbbcc 100644 --- a/lib/net/pop.rb +++ b/lib/net/pop.rb @@ -1,6 +1,6 @@ =begin -= Net module version 1.0.2 reference manual += Net module version 1.0.3 reference manual pop.rb written by Minero Aoki <aamine@dp.u-netsurf.ne.jp> @@ -167,6 +167,10 @@ Object @deleted end + def uidl + @proto.uidl @num + end + end end # POP3Session @@ -219,6 +223,11 @@ Net::Command class POP3Command < Command + def initialize( sock ) + @uidl = nil + super + end + =begin @@ -323,11 +332,19 @@ Net::Command def dele( num ) - @socket.writeline( sprintf( 'DELE %s', num ) ) + @socket.writeline( 'DELE ' + num.to_s ) check_reply( SuccessCode ) end + def uidl( num ) + @socket.writeline( 'UIDL ' + num.to_s ) + rep = check_reply( SuccessCode ) + uid = rep.msg.split(' ')[1] + + uid + end + private @@ -412,7 +429,7 @@ POP3 end - unless Session::Version == '1.0.2' then + unless Session::Version == '1.0.3' then $stderr.puts "WARNING: wrong version of session.rb & pop.rb" end diff --git a/lib/net/session.rb b/lib/net/session.rb index 3f7ef7f51f..3863d8506e 100644 --- a/lib/net/session.rb +++ b/lib/net/session.rb @@ -1,6 +1,6 @@ =begin -= Net module version 1.0.2 reference manual += Net module version 1.0.3 reference manual session.rb written by Minero Aoki <aamine@dp.u-netsurf.ne.jp> @@ -39,7 +39,7 @@ Object : Version - The version of Session class. It is a string like "1.0.2". + The version of Session class. It is a string like "1.0.3". =end @@ -48,7 +48,7 @@ module Net class Session - Version = '1.0.2' + Version = '1.0.3' =begin @@ -71,7 +71,9 @@ module Net proto_initialize @address = addr @port = port if port + @active = false + @pipe = nil end class << self @@ -133,12 +135,12 @@ module Net return false if active? @active = true - if ProtocolSocket === args[0] then - @socket = args.shift - @socket.pipe = @pipe + if Class === args[0] then + c = args.shift else - @socket = ProtocolSocket.open( @address, @port, @pipe ) + c = ProtocolSocket end + @socket = c.open( @address, @port, @pipe ) @pipe = nil @proto = @proto_type.new( @socket ) diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb index de97feaa23..6294512ffc 100644 --- a/lib/net/smtp.rb +++ b/lib/net/smtp.rb @@ -1,6 +1,6 @@ =begin -= Net module version 1.0.2 reference manual += Net module version 1.0.3 reference manual smtp.rb written by Minero Aoki <aamine@dp.u-netsurf.ne.jp> @@ -212,7 +212,7 @@ Net::Command end - unless Session::Version == '1.0.2' then + unless Session::Version == '1.0.3' then $stderr.puts "WARNING: wrong version of session.rb & smtp.rb" end |