1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

o remove RD white lines

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
aamine 2000-01-05 07:55:36 +00:00
parent de71615260
commit deee7cb19f
4 changed files with 3 additions and 64 deletions

View file

@ -27,29 +27,24 @@ class HTTPBadResponse < HTTPError; end
== Class Methods == Class Methods
: new( address, port = 80 ) : new( address, port = 80 )
create new HTTP object. create new HTTP object.
: port : port
returns HTTP default port, 80 returns HTTP default port, 80
: command_type : command_type
returns Command class, HTTPCommand returns Command class, HTTPCommand
== Methods == Methods
: get( path, header = nil, ret = '' ) : get( path, header = nil, ret = '' )
get data from "path" on connecting host. get data from "path" on connecting host.
"header" is a Hash like { 'Accept' => '*/*', ... }. "header" is a Hash like { 'Accept' => '*/*', ... }.
The data will be written to "ret" using "<<" method. The data will be written to "ret" using "<<" method.
This method returns response header (Hash) and "ret". This method returns response header (Hash) and "ret".
: head( path, header = nil ) : head( path, header = nil )
get only header from "path" on connecting host. get only header from "path" on connecting host.
"header" is a Hash like { 'Accept' => '*/*', ... }. "header" is a Hash like { 'Accept' => '*/*', ... }.
This method returns header as a Hash like This method returns header as a Hash like

View file

@ -28,7 +28,6 @@ Net::Protocol
=== Class Methods === Class Methods
: new( address = 'localhost', port = 110 ) : new( address = 'localhost', port = 110 )
This method create a new POP3 object. This method create a new POP3 object.
This will not open connection yet. This will not open connection yet.
@ -36,15 +35,12 @@ Net::Protocol
=== Methods === Methods
: start( account, password ) : start( account, password )
This method start POP3. This method start POP3.
: each{|popmail| ...} : each{|popmail| ...}
This method is equals to "pop3.mails.each" This method is equals to "pop3.mails.each"
: mails : mails
This method returns an array of ((URL:#POPMail)). This method returns an array of ((URL:#POPMail)).
This array is renewed when login. This array is renewed when login.
@ -110,28 +106,22 @@ Object
: all : all
: pop : pop
: mail : mail
This method fetches a mail and return it. This method fetches a mail and return it.
: header : header
This method fetches only mail header. This method fetches only mail header.
: top( lines ) : top( lines )
This method fetches mail header and 'lines' lines body. This method fetches mail header and 'lines' lines body.
: delete : delete
: delete! : delete!
This method deletes mail. This method deletes mail.
: size : size
size of mail(bytes) size of mail(bytes)
: deleted? : deleted?
true if mail was deleted true if mail was deleted
=end =end
@ -214,19 +204,16 @@ Net::Command
=== Class Methods === Class Methods
: new( socket ) : new( socket )
This method creates new POP3Command object. 'socket' must be ProtocolSocket. This method creates new POP3Command object. 'socket' must be ProtocolSocket.
=== Methods === Methods
: auth( account, password ) : auth( account, password )
This method do POP authorization (no RPOP) This method do POP authorization (no RPOP)
In case of failed authorization, raises Protocol::ProtocolError exception. In case of failed authorization, raises Protocol::ProtocolError exception.
: list : list
a list of mails which existing on server. a list of mails which existing on server.
The list is an array like "array[ number ] = size". The list is an array like "array[ number ] = size".
@ -244,29 +231,22 @@ Net::Command
[ nil, 2452, 3355, nil, 9842, ... ] [ nil, 2452, 3355, nil, 9842, ... ]
: quit : quit
This method ends POP using 'QUIT' commmand. This method ends POP using 'QUIT' commmand.
: rset : rset
This method reset all changes done in current session, This method reset all changes done in current session,
by sending 'RSET' command. by sending 'RSET' command.
: top( num, lines = 0 ) : top( num, lines = 0 )
This method gets all mail header and 'lines' lines body This method gets all mail header and 'lines' lines body
by sending 'TOP' command. 'num' is mail number. by sending 'TOP' command. 'num' is mail number.
WARNING: the TOP command is 'Optional' in RFC1939 (POP3) WARNING: the TOP command is 'Optional' in RFC1939 (POP3)
: retr( num : Integer ) : retr( num : Integer )
This method gets a mail by 'RETR' command. 'num' is mail number. This method gets a mail by 'RETR' command. 'num' is mail number.
: dele( num : Integer ) : dele( num : Integer )
This method deletes a mail on server by 'DELE'. This method deletes a mail on server by 'DELE'.
=end =end
@ -377,7 +357,6 @@ POP3Command
=== Methods === Methods
: auth( account, password ) : auth( account, password )
This method do authorization by sending 'APOP' command. This method do authorization by sending 'APOP' command.
If server is not APOP server, this raises Net::ProtoAuthError exception. If server is not APOP server, this raises Net::ProtoAuthError exception.
On other errors, raises Net::ProtocolError. On other errors, raises Net::ProtocolError.

View file

@ -29,25 +29,21 @@ Object
=== Constants === Constants
: Version : Version
The version of Session class. It is a string like "1.1.3". The version of Session class. It is a string like "1.1.3".
=== Class Methods === Class Methods
: new( address = 'localhost', port = nil ) : new( address = 'localhost', port = nil )
This method Creates a new Session object. This method Creates a new Session object.
: start( address = 'localhost', port = nil, *args ) : start( address = 'localhost', port = nil, *args )
: start( address = 'localhost', port = nil, *args ){|session| .... } : start( address = 'localhost', port = nil, *args ){|session| .... }
This method creates a new Session object and start session. This method creates a new Session object and start session.
If you call this method with block, Session object give itself If you call this method with block, Session object give itself
to block and finish session when block returns. to block and finish session when block returns.
: Proxy( address, port ) : Proxy( address, port )
This method creates a proxy class of its protocol. This method creates a proxy class of its protocol.
Arguments are address/port of proxy host. Arguments are address/port of proxy host.
@ -55,27 +51,22 @@ Object
=== Methods === Methods
: address : address
the address of connecting server (FQDN). the address of connecting server (FQDN).
: port : port
connecting port number connecting port number
: start( *args ) : start( *args )
This method start protocol. If you call this method when the protocol This method start protocol. If you call this method when the protocol
is already started, this only returns false without doing anything. is already started, this only returns false without doing anything.
'*args' are specified in subclasses. '*args' are specified in subclasses.
: finish : finish
This method ends protocol. If you call this method before protocol starts, This method ends protocol. If you call this method before protocol starts,
it only return false without doing anything. it only return false without doing anything.
: active? : active?
true if session have been started true if session have been started
=end =end
@ -255,7 +246,6 @@ Object
=== Class Methods === Class Methods
: new( socket ) : new( socket )
This method create new Command object. 'socket' must be ProtocolSocket. This method create new Command object. 'socket' must be ProtocolSocket.
This method is abstract class. This method is abstract class.
@ -263,7 +253,6 @@ Object
=== Methods === Methods
: quit : quit
This method dispatch command which ends the protocol. This method dispatch command which ends the protocol.
=end =end
@ -394,53 +383,42 @@ Object
=== Class Methods === Class Methods
: new( address = 'localhost', port = nil ) : new( address = 'localhost', port = nil )
This create new ProtocolSocket object, and connect to server. This create new ProtocolSocket object, and connect to server.
=== Methods === Methods
: close : close
This method closes socket. This method closes socket.
: address, addr : address, addr
a FQDN address of server a FQDN address of server
: ip_address, ipaddr : ip_address, ipaddr
an IP address of server an IP address of server
: port : port
connecting port number. connecting port number.
: closed? : closed?
true if ProtocolSokcet have been closed already true if ProtocolSokcet have been closed already
: read( length ) : read( length )
This method read 'length' bytes and return the string. This method read 'length' bytes and return the string.
: readuntil( target ) : readuntil( target )
This method read until find 'target'. Returns read string. This method read until find 'target'. Returns read string.
: readline : readline
read until "\r\n" and returns it without "\r\n". read until "\r\n" and returns it without "\r\n".
: read_pendstr : read_pendstr
This method read until "\r\n.\r\n". This method read until "\r\n.\r\n".
At the same time, delete period at line head and final line ("\r\n.\r\n"). At the same time, delete period at line head and final line ("\r\n.\r\n").
: read_pendlist : read_pendlist
: read_pendlist{|line| .... } : read_pendlist{|line| .... }
This method read until "\r\n.\r\n". This method resembles to 'read_pendstr', This method read until "\r\n.\r\n". This method resembles to 'read_pendstr',
but 'read_pendlist' don't check period at line head, and returns array which but 'read_pendlist' don't check period at line head, and returns array which
each element is one line. each element is one line.
@ -449,21 +427,17 @@ Object
: write( src ) : write( src )
This method send 'src'. ProtocolSocket read strings from 'src' by 'each' This method send 'src'. ProtocolSocket read strings from 'src' by 'each'
iterator. This method returns written bytes. iterator. This method returns written bytes.
: writebin( src ) : writebin( src )
This method send 'src'. ProtocolSokcet read string from 'src' by 'each' This method send 'src'. ProtocolSokcet read string from 'src' by 'each'
iterator. This method returns written bytes. iterator. This method returns written bytes.
: writeline( str ) : writeline( str )
This method writes 'str'. There has not to be bare "\r" or "\n" in 'str'. This method writes 'str'. There has not to be bare "\r" or "\n" in 'str'.
: write_pendstr( src ) : write_pendstr( src )
This method writes 'src' as a mail. This method writes 'src' as a mail.
ProtocolSocket reads strings from 'src' by 'each' iterator. ProtocolSocket reads strings from 'src' by 'each' iterator.
This returns written bytes. This returns written bytes.

View file

@ -27,21 +27,19 @@ Net::Protocol
=== Class Methods === Class Methods
: new( address = 'localhost', port = 25 ) : new( address = 'localhost', port = 25 )
This method create new SMTP object. This method create new SMTP object.
=== Methods === Methods
: start( helo_domain = ENV['HOSTNAME'] ) : start( helo_domain = ENV['HOSTNAME'] )
This method opens TCP connection and start SMTP. This method opens TCP connection and start SMTP.
If protocol had been started, do nothing and return false. If protocol had been started, do nothing and return false.
: sendmail( mailsrc, from_domain, to_addrs ) : sendmail( mailsrc, from_domain, to_addrs )
This method sends 'mailsrc' as mail. SMTPSession read strings
This method sends 'mailsrc' as mail. SMTPSession read strings from 'mailsrc' from 'mailsrc' by calling 'each' iterator, and convert them
by calling 'each' iterator, and convert them into "\r\n" terminated string when write. into "\r\n" terminated string when write.
Exceptions which SMTP raises are: Exceptions which SMTP raises are:
* Net::ProtoSyntaxError: syntax error (errno.500) * Net::ProtoSyntaxError: syntax error (errno.500)
@ -50,7 +48,6 @@ Net::Protocol
* Net::ProtoServerBusy: temporary error (errno.420/450) * Net::ProtoServerBusy: temporary error (errno.420/450)
: finish : finish
This method ends SMTP. This method ends SMTP.
If protocol had not started, do nothind and return false. If protocol had not started, do nothind and return false.
@ -98,34 +95,28 @@ Net::Command
=== Class Methods === Class Methods
: new( socket ) : new( socket )
This method creates new SMTPCommand object, and open SMTP. This method creates new SMTPCommand object, and open SMTP.
=== Methods === Methods
: helo( helo_domain ) : helo( helo_domain )
This method send "HELO" command and start SMTP. This method send "HELO" command and start SMTP.
helo_domain is localhost's FQDN. helo_domain is localhost's FQDN.
: mailfrom( from_addr ) : mailfrom( from_addr )
This method sends "MAIL FROM" command. This method sends "MAIL FROM" command.
from_addr is your mail address(????@????). from_addr is your mail address(????@????).
: rcpt( to_addrs ) : rcpt( to_addrs )
This method sends "RCPT TO" command. This method sends "RCPT TO" command.
to_addrs is array of mail address(???@???) of destination. to_addrs is array of mail address(???@???) of destination.
: data( mailsrc ) : data( mailsrc )
This method send 'mailsrc' as mail. SMTP reads strings from 'mailsrc' This method send 'mailsrc' as mail. SMTP reads strings from 'mailsrc'
by calling 'each' iterator. by calling 'each' iterator.
: quit : quit
This method sends "QUIT" command and ends SMTP session. This method sends "QUIT" command and ends SMTP session.
=end =end