vendor/cache/ruby/2.3.0/gems/warden-github-rails-1.3.0/lib/warden/github/rails/routes.rb
# Enforces an authenticated GitHub user for the routes. If not
# authenticated, it initiates the OAuth flow.
#
# Team and organization memberships can be checked by specifying a hash
# such as `team: 'foobar'` or `org: 'my_company'`.
Enforces an authenticated GitHub user for the routes. If not
authenticated, it initiates the OAuth flow.

Team and organization memberships can be checked by specifying a hash
such as `team: 'foobar'` or `org: 'my_company'`.
Enforces an authenticated GitHub user for the routes . If not authenticated it initiates the OAuth flow . Team and organization memberships can be checked by specifying a hash such as ` team : ' foobar ' ` or ` org : ' my_company ' ` .
def github_constraint(scope, options, routes_block, &block)
          options, scope = scope, nil  if scope.is_a? Hash
          scope ||= Rails.default_scope
          constraint = lambda do |request|
            warden = request.env['warden']
            if block.call(warden, scope)
              if (user = warden.user(scope))
                evaled_options = github_eval_options(options, request)
                github_enforce_options(user, evaled_options)
              else
                true
              end
            end
          end
          constraints(constraint, &routes_block)
        end
def github_constraint ( scope , options , routes_block , & block ) options , scope = scope , nil if scope . is_a? Hash scope ||= Rails . default_scope constraint = lambda do | request | warden = request . env [ 'warden' ] if block . call ( warden , scope ) if ( user = warden . user ( scope ) ) evaled_options = github_eval_options ( options , request ) github_enforce_options ( user , evaled_options ) else true end end end constraints ( constraint , & routes_block ) end
Enforces an authenticated GitHub user for the routes.
Enforces an authenticated GitHub user for the routes .
scope
<not_specific>
options
<not_specific>
routes_block
<not_specific>
block
<not_specific>