Skip to content

Commit

Permalink
aamine
Browse files Browse the repository at this point in the history
* lib/net/protocol.rb: Protocol.new requires at least one arg.
* lib/net/smtp.rb: ditto.
* lib/net/pop.rb: ditto.
* lib/net/http.rb: ditto.


git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
aamine committed Aug 17, 2001
1 parent 5897dea commit a31fc08
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 37 deletions.
12 changes: 12 additions & 0 deletions ChangeLog
@@ -1,3 +1,13 @@
Fri Aug 17 12:13:48 2001 Minero Aoki <aamine@loveruby.net>

* lib/net/protocol.rb: Protocol.new requires at least one arg.

* lib/net/smtp.rb: ditto.

* lib/net/pop.rb: ditto.

* lib/net/http.rb: ditto.

Thu Aug 16 13:54:04 2001 Usaku Nakamura <usa@ruby-lang.org>

* ext/socket/socket.c (s_recvfrom): fix typo.
Expand Down Expand Up @@ -311,6 +321,8 @@ Tue Jul 17 06:01:12 2001 Minero Aoki <aamine@loveruby.net>

* doc/net/smtp.rd.ja, pop.rd.ja, http.rd.ja: new files.

* MANIFEST: add doc/net/{http,pop,smtp}.rd.ja.

Tue Jul 17 11:22:01 2001 Yukihiro Matsumoto <matz@ruby-lang.org>

* regex.c (NUM_FAILURE_ITEMS): was confusing NUM_REG_ITEMS and
Expand Down
6 changes: 3 additions & 3 deletions doc/net/http.rd.ja
Expand Up @@ -119,14 +119,14 @@ Ruby 1.6

=== ���饹�᥽�å�

: new( address = 'localhost', port = 80, proxy_addr = nil, proxy_port = nil )
: new( address, port = 80, proxy_addr = nil, proxy_port = nil )
������ HTTP ���֥������Ȥ��������ޤ���address �� HTTP �����С��� FQDN �ǡ�
port ����³����ݡ����ֹ�Ǥ������Υ᥽�åɤǤϤޤ���³�Ϥ��ޤ���

proxy_addr ��Ϳ����ȥץ�������𤷤���³���륪�֥������Ȥ��������ޤ���

: start( address = 'localhost', port = 80, proxy_addr = nil, proxy_port = nil )
: start( address = 'localhost', port = 80, proxy_addr = nil, proxy_port = nil ) {|http| .... }
: start( address, port = 80, proxy_addr = nil, proxy_port = nil )
: start( address, port = 80, proxy_addr = nil, proxy_port = nil ) {|http| .... }
�ʲ���Ʊ���Ǥ���

Net::HTTP.new(address, port, proxy_addr, proxy_port).start(&block)
Expand Down
14 changes: 7 additions & 7 deletions doc/net/pop.rd.ja
Expand Up @@ -109,12 +109,12 @@ APOP ǧ

=== ���饹�᥽�å�

: new( address = 'localhost', port = 110, apop = false )
: new( address, port = 110, apop = false )
Net::POP3 ���֥������Ȥ��������ޤ����ޤ���³�Ϥ��ޤ���
apop �����ΤȤ��� APOP ǧ�ڤ�Ԥ����֥������Ȥ��������ޤ���

: start( address = 'localhost', port = 110, account, password )
: start( address = 'localhost', port = 110, account, password ) {|pop| .... }
: start( address, port = 110, account, password )
: start( address, port = 110, account, password ) {|pop| .... }
address �� port �֥ݡ��Ȥ���³������������� account �ѥ����
password �� POP �������󤷤ޤ���������� port �� nil ���Ϥ���
POP3 �Υǥե���ȥݡ���(110)��Ȥ��ޤ���
Expand All @@ -126,7 +126,7 @@ APOP ǧ
end
end

: foreach( address = 'localhost', port = 110, account, password ) {|mail| .... }
: foreach( address, port = 110, account, password ) {|mail| .... }
POP ���å����򳫤��������о�Τ��٤ƤΥ᡼����Ф��Ʒ����֤��ޤ���
�ʲ���Ʊ���Ǥ���

Expand All @@ -143,8 +143,8 @@ APOP ǧ
m.delete if $DELETE
end

: delete_all( address = 'localhost', port = 110, account, password )
: delete_all( address = 'localhost', port = 110, account, password ) {|mail| .... }
: delete_all( address, port = 110, account, password )
: delete_all( address, port = 110, account, password ) {|mail| .... }
POP ���å����򳫤��������о�Υ᡼��򤹤٤ƺ�����ޤ���
�֥��å���Ϳ����줿���Ϻ���������˥֥��å��ˤ��Υ᡼���
�Ϥ��ޤ����ʲ���Ʊ���Ǥ���
Expand All @@ -154,7 +154,7 @@ APOP ǧ
m.pop file
end

: auth_only( address = 'localhost', port = 110, account, password )
: auth_only( address, port = 110, account, password )
POP ���å����򳫤�ǧ�ڤ�����Ԥä���³���ڤ�ޤ���
POP before SMTP ���ѤǤ���

Expand Down
6 changes: 3 additions & 3 deletions doc/net/smtp.rd.ja
Expand Up @@ -71,12 +71,12 @@ SMTP

=== ���饹�᥽�å�

: new( address = 'localhost', port = 25 )
: new( address, port = 25 )
������ SMTP ���֥������Ȥ��������ޤ���address ��SMTP�����С���FQDN�ǡ�
port ����³����ݡ����ֹ�Ǥ��������������Υ᥽�åɤǤϤޤ���³�Ϥ��ޤ���

: start( address = 'localhost', port = 25, helo_domain = Socket.gethostname, account = nil, password = nil, authtype = nil )
: start( address = 'localhost', port = 25, helo_domain = Socket.gethostname, account = nil, password = nil, authtype = nil ) {|smtp| .... }
: start( address, port = 25, helo_domain = Socket.gethostname, account = nil, password = nil, authtype = nil )
: start( address, port = 25, helo_domain = Socket.gethostname, account = nil, password = nil, authtype = nil ) {|smtp| .... }
�ʲ���Ʊ���Ǥ���
Net::SMTP.new(address,port).start(helo_domain,account,password,authtype)

Expand Down
12 changes: 6 additions & 6 deletions lib/net/http.rb
Expand Up @@ -132,12 +132,12 @@
=== Class Methods
: new( address = 'localhost', port = 80, proxy_addr = nil, proxy_port = nil )
: new( address, port = 80, proxy_addr = nil, proxy_port = nil )
creates a new Net::HTTP object.
If proxy_addr is given, creates an Net::HTTP object with proxy support.
: start( address = 'localhost', port = 80, proxy_addr = nil, proxy_port = nil )
: start( address = 'localhost', port = 80, proxy_addr = nil, proxy_port = nil ) {|http| .... }
: start( address, port = 80, proxy_addr = nil, proxy_port = nil )
: start( address, port = 80, proxy_addr = nil, proxy_port = nil ) {|http| .... }
is equals to
Net::HTTP.new(address, port, proxy_addr, proxy_port).start(&block)
Expand Down Expand Up @@ -457,7 +457,7 @@ class HTTP < Protocol

protocol_param :port, '80'

def initialize( addr = nil, port = nil )
def initialize( addr, port = nil )
super

@curr_http_version = HTTPVersion
Expand Down Expand Up @@ -492,14 +492,14 @@ def Proxy( p_addr, p_port = nil )

alias orig_new new

def new( address = nil, port = nil, p_addr = nil, p_port = nil )
def new( address, port = nil, p_addr = nil, p_port = nil )
c = p_addr ? self::Proxy(p_addr, p_port) : self
i = c.orig_new( address, port )
setvar i
i
end

def start( address = nil, port = nil, p_addr = nil, p_port = nil, &block )
def start( address, port = nil, p_addr = nil, p_port = nil, &block )
new( address, port, p_addr, p_port ).start( &block )
end

Expand Down
24 changes: 12 additions & 12 deletions lib/net/pop.rb
Expand Up @@ -116,12 +116,12 @@
=== Class Methods
: new( address = 'localhost', port = 110, apop = false )
: new( address, port = 110, apop = false )
creates a new Net::POP3 object.
This method does not open TCP connection yet.
: start( address = 'localhost', port = 110, account, password )
: start( address = 'localhost', port = 110, account, password ) {|pop| .... }
: start( address, port = 110, account, password )
: start( address, port = 110, account, password ) {|pop| .... }
equals to Net::POP3.new( address, port ).start( account, password )
Net::POP3.start( addr, port, account, password ) do |pop|
Expand All @@ -131,7 +131,7 @@
end
end
: foreach( address = 'localhost', port = 110, account, password ) {|mail| .... }
: foreach( address, port = 110, account, password ) {|mail| .... }
starts POP3 protocol and iterates for each POPMail object.
This method equals to
Expand All @@ -148,8 +148,8 @@
m.delete if $DELETE
end
: delete_all( address = 'localhost', port = 110, account, password )
: delete_all( address = 'localhost', port = 110, account, password ) {|mail| .... }
: delete_all( address, port = 110, account, password )
: delete_all( address, port = 110, account, password ) {|mail| .... }
starts POP3 session and delete all mails.
If block is given, iterates for each POPMail object before delete.
Expand All @@ -158,7 +158,7 @@
m.pop file
end
: auth_only( address = 'localhost', port = 110, account, password )
: auth_only( address, port = 110, account, password )
(just for POP-before-SMTP)
opens POP3 session and does autholize and quit.
This method must not be called while POP3 session is opened.
Expand Down Expand Up @@ -303,35 +303,35 @@ class POP3 < Protocol

class << self

def foreach( address = nil, port = nil,
def foreach( address, port = nil,
account = nil, password = nil, &block )
start( address, port, account, password ) do |pop|
pop.each_mail( &block )
end
end

def delete_all( address = nil, port = nil,
def delete_all( address, port = nil,
account = nil, password = nil, &block )
start( address, port, account, password ) do |pop|
pop.delete_all( &block )
end
end

def auth_only( address = nil, port = nil,
def auth_only( address, port = nil,
account = nil, password = nil )
new( address, port ).auth_only account, password
end

end


def initialize( addr = nil, port = nil, apop = false )
def initialize( addr, port = nil, apop = false )
super addr, port
@mails = nil
@apop = false
end

def auth_only( account = nil, password = nil )
def auth_only( account, password )
begin
connect
@active = true
Expand Down
4 changes: 2 additions & 2 deletions lib/net/protocol.rb
Expand Up @@ -36,7 +36,7 @@ class Protocol

class << self

def start( address = 'localhost', port = nil, *args )
def start( address, port = nil, *args )
instance = new( address, port )

if block_given? then
Expand Down Expand Up @@ -79,7 +79,7 @@ def self.#{name.id2name}
protocol_param :socket_type, '::Net::NetPrivate::Socket'


def initialize( addr = nil, port = nil )
def initialize( addr, port = nil )
@address = addr || 'localhost'
@port = port || type.port

Expand Down
8 changes: 4 additions & 4 deletions lib/net/smtp.rb
Expand Up @@ -90,11 +90,11 @@
=== Class Methods
: new( address = 'localhost', port = 25 )
: new( address, port = 25 )
creates a new Net::SMTP object.
: start( address = 'localhost', port = 25, helo_domain = Socket.gethostname, account = nil, password = nil, authtype = nil )
: start( address = 'localhost', port = 25, helo_domain = Socket.gethostname, account = nil, password = nil, authtype = nil ) {|smtp| .... }
: start( address, port = 25, helo_domain = Socket.gethostname, account = nil, password = nil, authtype = nil )
: start( address, port = 25, helo_domain = Socket.gethostname, account = nil, password = nil, authtype = nil ) {|smtp| .... }
is equal to
Net::SMTP.new(address,port).start(helo_domain,account,password,authtype)
Expand Down Expand Up @@ -204,7 +204,7 @@ class SMTP < Protocol
protocol_param :command_type, '::Net::NetPrivate::SMTPCommand'


def initialize( addr = nil, port = nil )
def initialize( addr, port = nil )
super
@esmtp = true
end
Expand Down

0 comments on commit a31fc08

Please sign in to comment.