29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/omniauth/builder.rb', line 29
def provider(klass, *args, **opts, &block)
if klass.is_a?(Class)
middleware = klass
else
begin
middleware = OmniAuth::Strategies.const_get(OmniAuth::Utils.camelize(klass.to_s).to_s, false)
rescue NameError
raise(LoadError.new("Could not find matching strategy for #{klass.inspect}. You may need to install an additional gem (such as omniauth-#{klass})."))
end
end
use middleware, *args, **options.merge(opts), &block
end
|