Sfoglia il codice sorgente

Use keyword arguments for Net::IMAP.new

Akinori MUSHA 10 anni fa
parent
commit
3ce41669b4
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  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
       port = (Integer(port) if port.present?)
 
       log "Connecting to #{host}#{':%d' % port if port}#{' via SSL' if ssl}"
-      Client.open(host, port, ssl) { |imap|
+      Client.open(host, port: port, ssl: ssl) { |imap|
         log "Logging in as #{username}"
         imap.login(username, interpolated[:password])
 
@@ -437,8 +437,8 @@ module Agents
 
     class Client < ::Net::IMAP
       class << self
-        def open(host, port, ssl)
-          imap = new(host, port, ssl)
+        def open(host, *args)
+          imap = new(host, *args)
           yield imap
         ensure
           imap.disconnect unless imap.nil?