diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-08-17 03:08:45 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-08-17 03:08:45 +0000 |
commit | 772ed5507e569d7697841492a37d7607adbc9385 (patch) | |
tree | 2e30b9d1390670e908b5867208fbfb090e929faf /lib | |
parent | 1414cebea8ac4e04d3f5d7c258bc7c26258bc4be (diff) |
aamine
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@1700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/http.rb | 12 | ||||
-rw-r--r-- | lib/net/pop.rb | 24 | ||||
-rw-r--r-- | lib/net/protocol.rb | 4 | ||||
-rw-r--r-- | lib/net/smtp.rb | 8 |
4 files changed, 24 insertions, 24 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index f96859be1e..455c3987ff 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -132,12 +132,12 @@ Yes, this is not thread-safe. === 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) @@ -457,7 +457,7 @@ module Net protocol_param :port, '80' - def initialize( addr = nil, port = nil ) + def initialize( addr, port = nil ) super @curr_http_version = HTTPVersion @@ -492,14 +492,14 @@ module Net 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 diff --git a/lib/net/pop.rb b/lib/net/pop.rb index c05d42ad1e..df46f06934 100644 --- a/lib/net/pop.rb +++ b/lib/net/pop.rb @@ -116,12 +116,12 @@ net/pop also supports APOP authentication. There's two way to use APOP: === 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| @@ -131,7 +131,7 @@ net/pop also supports APOP authentication. There's two way to use APOP: 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 @@ -148,8 +148,8 @@ net/pop also supports APOP authentication. There's two way to use 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| .... } starts POP3 session and delete all mails. If block is given, iterates for each POPMail object before delete. @@ -158,7 +158,7 @@ net/pop also supports APOP authentication. There's two way to use APOP: 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. @@ -303,21 +303,21 @@ module Net 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 @@ -325,13 +325,13 @@ module Net 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 diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb index 5835c136bf..ac2753ad79 100644 --- a/lib/net/protocol.rb +++ b/lib/net/protocol.rb @@ -36,7 +36,7 @@ module Net class << self - def start( address = 'localhost', port = nil, *args ) + def start( address, port = nil, *args ) instance = new( address, port ) if block_given? then @@ -79,7 +79,7 @@ module Net 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 diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb index b7dfbf822b..05f5a20b49 100644 --- a/lib/net/smtp.rb +++ b/lib/net/smtp.rb @@ -90,11 +90,11 @@ send or reject SMTP session by this data. === 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) @@ -204,7 +204,7 @@ module Net protocol_param :command_type, '::Net::NetPrivate::SMTPCommand' - def initialize( addr = nil, port = nil ) + def initialize( addr, port = nil ) super @esmtp = true end |