Use keyword arguments for Net::IMAP.new

Akinori MUSHA 9 年 前
コミット
3ce41669b4
共有1 個のファイルを変更した3 個の追加3 個の削除を含む
  1. 3 3
      app/models/agents/imap_folder_agent.rb

+ 3 - 3
app/models/agents/imap_folder_agent.rb

@@ -322,7 +322,7 @@ module Agents
322 322
       port = (Integer(port) if port.present?)
323 323
 
324 324
       log "Connecting to #{host}#{':%d' % port if port}#{' via SSL' if ssl}"
325
-      Client.open(host, port, ssl) { |imap|
325
+      Client.open(host, port: port, ssl: ssl) { |imap|
326 326
         log "Logging in as #{username}"
327 327
         imap.login(username, interpolated[:password])
328 328
 
@@ -437,8 +437,8 @@ module Agents
437 437
 
438 438
     class Client < ::Net::IMAP
439 439
       class << self
440
-        def open(host, port, ssl)
441
-          imap = new(host, port, ssl)
440
+        def open(host, *args)
441
+          imap = new(host, *args)
442 442
           yield imap
443 443
         ensure
444 444
           imap.disconnect unless imap.nil?