lib/sym/app/password/providers.rb in sym-2.2.1 vs lib/sym/app/password/providers.rb in sym-2.3.0

- old
+ new

@@ -20,25 +20,25 @@ self.detected ||= self.providers.inject(nil) do |instance, provider_class| instance || (p = provider_class.new; p.alive? ? p : nil) end end - def provider(p = nil) - provider_from_argument(p) || detect + def provider(p = nil, **opts, &block) + provider_from_argument(p, **opts, &block) || detect end private def short_name(klass) klass.name.gsub(/.*::(\w+)Provider/, '\1').downcase.to_sym end - def provider_from_argument(p) + def provider_from_argument(p, **opts, &block) case p when String, Symbol provider_class_name = "#{p.to_s.capitalize}Provider" Sym::App::Password::Providers.const_defined?(provider_class_name) ? - Sym::App::Password::Providers.const_get(provider_class_name).new : + Sym::App::Password::Providers.const_get(provider_class_name).new(**opts, &block) : nil end end end end