mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/net/pop.rb: rename method: POP3#mail_size -> n_mails
* lib/net/pop.rb: rename method: POP3#bytes -> n_bytes git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
01ca1341da
commit
273a14a44c
2 changed files with 24 additions and 26 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Tue May 6 17:51:54 2003 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
|
* lib/net/pop.rb: rename method: POP3#mail_size -> n_mails
|
||||||
|
|
||||||
|
* lib/net/pop.rb: rename method: POP3#bytes -> n_bytes
|
||||||
|
|
||||||
Tue May 6 17:21:01 2003 Minero Aoki <aamine@loveruby.net>
|
Tue May 6 17:21:01 2003 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
* ext/bigdecimal/.cvsignore: new file.
|
* ext/bigdecimal/.cvsignore: new file.
|
||||||
|
|
|
@ -226,6 +226,7 @@ Normally unique-id is a hash of the message.
|
||||||
|
|
||||||
: auth_only( address, port = 110, account, password, isapop = false )
|
: auth_only( address, port = 110, account, password, isapop = false )
|
||||||
(just for POP-before-SMTP)
|
(just for POP-before-SMTP)
|
||||||
|
|
||||||
opens POP3 session and does autholize and quit.
|
opens POP3 session and does autholize and quit.
|
||||||
This method must not be called while POP3 session is opened.
|
This method must not be called while POP3 session is opened.
|
||||||
This method raises POPAuthenticationError if authentication is failed.
|
This method raises POPAuthenticationError if authentication is failed.
|
||||||
|
@ -272,6 +273,12 @@ Normally unique-id is a hash of the message.
|
||||||
finishes POP3 session.
|
finishes POP3 session.
|
||||||
If POP3 session had not be started, raises an IOError.
|
If POP3 session had not be started, raises an IOError.
|
||||||
|
|
||||||
|
: n_mails
|
||||||
|
returns the number of mails on the POP server.
|
||||||
|
|
||||||
|
: n_bytes
|
||||||
|
returns the bytes of all mails on the POP server.
|
||||||
|
|
||||||
: mails
|
: mails
|
||||||
an array of Net::POPMail objects.
|
an array of Net::POPMail objects.
|
||||||
This array is renewed when session restarts.
|
This array is renewed when session restarts.
|
||||||
|
@ -298,21 +305,6 @@ Normally unique-id is a hash of the message.
|
||||||
|
|
||||||
This method raises POPError if any problem happend.
|
This method raises POPError if any problem happend.
|
||||||
|
|
||||||
: auth_only( account, password )
|
|
||||||
(just for POP-before-SMTP)
|
|
||||||
|
|
||||||
opens POP3 session, does authorization, then quit.
|
|
||||||
You must not call this method after POP3 session is opened.
|
|
||||||
|
|
||||||
This method raises POPAuthenticationError if authentication is failed.
|
|
||||||
|
|
||||||
# Typical usage
|
|
||||||
pop = Net::POP3.new('your.pop3.server')
|
|
||||||
pop.auth_only('Your account', 'Your password')
|
|
||||||
Net::SMTP.start(....) {|smtp|
|
|
||||||
....
|
|
||||||
}
|
|
||||||
|
|
||||||
: reset
|
: reset
|
||||||
reset the session. All "deleted mark" are removed.
|
reset the session. All "deleted mark" are removed.
|
||||||
|
|
||||||
|
@ -477,8 +469,8 @@ module Net
|
||||||
@debug_output = nil
|
@debug_output = nil
|
||||||
|
|
||||||
@mails = nil
|
@mails = nil
|
||||||
@nmails = nil
|
@n_mails = nil
|
||||||
@bytes = nil
|
@n_bytes = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def apop?
|
def apop?
|
||||||
|
@ -565,21 +557,21 @@ module Net
|
||||||
# POP protocol wrapper
|
# POP protocol wrapper
|
||||||
#
|
#
|
||||||
|
|
||||||
def mail_size
|
def n_mails
|
||||||
return @nmails if @nmails
|
return @n_mails if @n_mails
|
||||||
@nmails, @bytes = command().stat
|
@n_mails, @n_bytes = command().stat
|
||||||
@nmails
|
@n_mails
|
||||||
end
|
end
|
||||||
|
|
||||||
def bytes
|
def n_bytes
|
||||||
return @bytes if @bytes
|
return @n_bytes if @n_bytes
|
||||||
@nmails, @bytes = command().stat
|
@n_mails, @n_bytes = command().stat
|
||||||
@bytes
|
@n_bytes
|
||||||
end
|
end
|
||||||
|
|
||||||
def mails
|
def mails
|
||||||
return @mails.dup if @mails
|
return @mails.dup if @mails
|
||||||
if mail_size() == 0
|
if n_mails() == 0
|
||||||
# some popd raises error for LIST on the empty mailbox.
|
# some popd raises error for LIST on the empty mailbox.
|
||||||
@mails = []
|
@mails = []
|
||||||
return []
|
return []
|
||||||
|
|
Loading…
Reference in a new issue