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 @@ -68,7 +68,7 @@ def names; @authenticators.keys end
6868 # When only a single argument is given, the authenticator class will be
6969 # lazily loaded from <tt>Net::IMAP::SASL::#{name}Authenticator</tt> (case is
7070 # preserved and non-alphanumeric characters are removed..
71- def add_authenticator ( name , authenticator = nil )
71+ def add_authenticator ( name , authenticator = nil , warn_overwrite : true )
7272 authenticator ||= begin
7373 class_name = "#{ name . gsub ( /[^a-zA-Z0-9]/ , "" ) } Authenticator" . to_sym
7474 auth_class = nil
@@ -78,6 +78,11 @@ def add_authenticator(name, authenticator = nil)
7878 }
7979 end
8080 key = Authenticators . normalize_name ( name )
81+ if warn_overwrite && ( original = @authenticators [ key ] )
82+ warn ( "%p: replacing existing %p authenticator: %p" % [
83+ self , key , original
84+ ] , uplevel : 1 )
85+ end
8186 @authenticators [ key ] = authenticator
8287 end
8388
You can’t perform that action at this time.
0 commit comments