File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ def names; @authenticators.keys end
6565 # When only a single argument is given, the authenticator class will be
6666 # lazily loaded from <tt>Net::IMAP::SASL::#{name}Authenticator</tt> (case is
6767 # preserved and non-alphanumeric characters are removed..
68- def add_authenticator ( name , authenticator = nil )
68+ def add_authenticator ( name , authenticator = nil , warn_overwrite : true )
6969 key = name . upcase . to_sym
7070 authenticator ||= begin
7171 class_name = "#{ name . gsub ( /[^a-zA-Z0-9]/ , "" ) } Authenticator" . to_sym
@@ -75,6 +75,11 @@ def add_authenticator(name, authenticator = nil)
7575 auth_class . new ( *creds , **props , &block )
7676 }
7777 end
78+ if warn_overwrite && ( original = @authenticators [ key ] )
79+ warn ( "%p: replacing existing %p authenticator: %p" % [
80+ self , key , original
81+ ] , uplevel : 1 )
82+ end
7883 @authenticators [ key ] = authenticator
7984 end
8085
You can’t perform that action at this time.
0 commit comments