lib/sym/app/password/providers.rb in sym-2.8.5 vs lib/sym/app/password/providers.rb in sym-2.10.0
- old
+ new
@@ -13,11 +13,11 @@
registry[short_name(provider_class)] = provider_class
self.providers ||= []
self.providers << provider_class
end
- # Detect first instance that is "alive?" and return it.
+ # Detect first instance tht is "alive?" and return it.
def detect
self.detected ||= self.providers.inject(nil) do |instance, provider_class|
instance || (p = provider_class.new; p.alive? ? p : nil)
end
end
@@ -36,11 +36,11 @@
klass.name.gsub(/.*::(\w+)Provider/, '\1').downcase.to_sym
end
def provider_from_argument(p, **opts, &block)
case p
- when String, Symbol
+ 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(**opts, &block) :
nil
end
@@ -51,6 +51,5 @@
end
end
# Order is important — they are tried in this order for auto detect
require 'sym/app/password/providers/memcached_provider'
-require 'sym/app/password/providers/drb_provider'