Skip to content

Commit

Permalink
Making the config API more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
roman committed Sep 7, 2009
1 parent 9ec3067 commit e61cfd5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/warden_oauth/manager.rb
Expand Up @@ -9,11 +9,16 @@ def self.included(base)


def oauth(service, &block) def oauth(service, &block)
config = Warden::OAuth::Config.new 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.check_requirements
config.provider_name = service config.provider_name = service
Warden::OAuth::Strategy.build(service, config) Warden::OAuth::Strategy.build(service, config)
#@config[:oauth_services][service] = config
end end


module ClassMethods module ClassMethods
Expand Down

0 comments on commit e61cfd5

Please sign in to comment.