ruby-changes:2917
From: ko1@a...
Date: 21 Dec 2007 15:34:14 +0900
Subject: [ruby-changes:2917] shugo - Ruby:r14408 (trunk): * lib/net/imap.rb (initialize): accept service name. changed
shugo 2007-12-21 15:34:03 +0900 (Fri, 21 Dec 2007) New Revision: 14408 Modified files: trunk/ChangeLog trunk/lib/net/imap.rb Log: * lib/net/imap.rb (initialize): accept service name. changed the defalut value of the old style +verify+ argument to true. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/net/imap.rb?r1=14408&r2=14407 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14408&r2=14407 Index: ChangeLog =================================================================== --- ChangeLog (revision 14407) +++ ChangeLog (revision 14408) @@ -1,3 +1,8 @@ +Fri Dec 21 15:24:22 2007 Shugo Maeda <shugo@r...> + + * lib/net/imap.rb (initialize): accept service name. changed + the defalut value of the old style +verify+ argument to true. + Fri Dec 21 15:15:44 2007 Tanaka Akira <akr@f...> * gc.c (rb_garbage_collect): new function for debugging. Index: lib/net/imap.rb =================================================================== --- lib/net/imap.rb (revision 14407) +++ lib/net/imap.rb (revision 14408) @@ -330,7 +330,7 @@ end # Sends a STARTTLS command to start TLS session. - def starttls(options = {}, verify = false) + def starttls(options = {}, verify = true) send_command("STARTTLS") do |resp| if resp.kind_of?(TaggedResponse) && resp.name == "OK" begin @@ -909,20 +909,18 @@ # Net::IMAP::ByeResponseError:: we connected to the host, but they # immediately said goodbye to us. def initialize(host, port_or_options = {}, - usessl = false, certs = nil, verify = false) + usessl = false, certs = nil, verify = true) super() @host = host begin + options = port_or_options.to_hash + rescue NoMethodError # for backward compatibility - port = port_or_options.to_int - options = { - :port => port - } + options = {} + options[:port] = port_or_options if usessl options[:ssl] = create_ssl_params(certs, verify) end - rescue NoMethodError - options = port_or_options end @port = options[:port] || (options[:ssl] ? SSL_PORT : PORT) @tag_prefix = "RUBY" @@ -1240,7 +1238,7 @@ end end - def create_ssl_params(certs = nil, verify = false) + def create_ssl_params(certs = nil, verify = true) params = {} if certs if File.file?(certs) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml