Sha256: 05b3b4bf3c5852cda05d2fb4e5ebcfa18460235dba44b53cd8b3adda70a31dd0

Contents?: true

Size: 1.86 KB

Versions: 2

Compression:

Stored size: 1.86 KB

Contents

require "doorkeeper/version"
require "doorkeeper/engine"
require "doorkeeper/config"
require "doorkeeper/doorkeeper_for"

module Doorkeeper
  autoload :Validations, "doorkeeper/validations"

  module OAuth
    autoload :Scopes,                     "doorkeeper/oauth/scopes"
    autoload :Error,                      "doorkeeper/oauth/error"
    autoload :ErrorResponse,              "doorkeeper/oauth/error_response"
    autoload :AuthorizationRequest,       "doorkeeper/oauth/authorization_request"
    autoload :AccessTokenRequest,         "doorkeeper/oauth/access_token_request"
    autoload :PasswordAccessTokenRequest, "doorkeeper/oauth/password_access_token_request"
    autoload :ClientCredentialsRequest,   "doorkeeper/oauth/client_credentials_request"
    autoload :Authorization,              "doorkeeper/oauth/authorization"
    autoload :Client,                     "doorkeeper/oauth/client"
    autoload :Token,                      "doorkeeper/oauth/token"

    module Helpers
      autoload :ScopeChecker, "doorkeeper/oauth/helpers/scope_checker"
      autoload :URIChecker,   "doorkeeper/oauth/helpers/uri_checker"
      autoload :UniqueToken,  "doorkeeper/oauth/helpers/unique_token"
    end
  end

  module Models
    autoload :Scopes,     'doorkeeper/models/scopes'
    autoload :Expirable,  'doorkeeper/models/expirable'
    autoload :Revocable,  'doorkeeper/models/revocable'
    autoload :Accessible, 'doorkeeper/models/accessible'
  end

  module Helpers
    autoload :Filter, "doorkeeper/helpers/filter"
    autoload :Controller, "doorkeeper/helpers/controller"
  end

  module Rails
    autoload :Routes, "doorkeeper/rails/routes"
  end

  def self.configured?
    @config.present?
  end

  def self.database_installed?
    [AccessToken, AccessGrant, Application].all? { |model| model.table_exists? }
  end

  def self.installed?
    configured? && database_installed?
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
doorkeeper-0.5.0 lib/doorkeeper.rb
doorkeeper-0.5.0.rc1 lib/doorkeeper.rb