summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/net/pop.rb23
-rw-r--r--lib/net/session.rb16
-rw-r--r--lib/net/smtp.rb4
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