Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Making the config API more flexible

  • Loading branch information...
commit e61cfd571d570a8ee0f63310e28b802b0927e3d6 1 parent 9ec3067
@roman authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/warden_oauth/manager.rb
View
9 lib/warden_oauth/manager.rb
@@ -9,11 +9,16 @@ def self.included(base)
def oauth(service, &block)
config = Warden::OAuth::Config.new
- yield config
+ if block_given?
+ if block.arity == 1
+ yield config
+ else
+ config.instance_eval(&block)
+ end
+ end
config.check_requirements
config.provider_name = service
Warden::OAuth::Strategy.build(service, config)
- #@config[:oauth_services][service] = config
end
module ClassMethods
Please sign in to comment.
Something went wrong with that request. Please try again.