Permalink
Browse files

Simplify autoload stack.

  • Loading branch information...
1 parent 9095d52 commit 3432c9eef4bca1e4fb446d9588a65a44930b52ed @josevalim josevalim committed Dec 13, 2009
Showing with 27 additions and 29 deletions.
  1. +4 −0 README.rdoc
  2. +23 −6 lib/devise.rb
  3. +0 −7 lib/devise/controllers.rb
  4. +0 −9 lib/devise/encryptors.rb
  5. +0 −7 lib/devise/orm.rb
View
@@ -42,6 +42,10 @@ Configure warden and devise gems inside your app:
config.gem 'warden'
config.gem 'devise'
+Run the generator:
+
+ ruby script/generate devise_install
+
And you're ready to go.
== Basic Usage
View
@@ -1,7 +1,28 @@
module Devise
- autoload :Schema, 'devise/schema'
- autoload :Mapping, 'devise/mapping'
autoload :FailureApp, 'devise/failure_app'
+ autoload :Mapping, 'devise/mapping'
+ autoload :Schema, 'devise/schema'
+ autoload :TestHelpers, 'devise/test_helpers'
+
+ module Controllers
+ autoload :Filters, 'devise/controllers/filters'
+ autoload :Helpers, 'devise/controllers/helpers'
+ autoload :UrlHelpers, 'devise/controllers/url_helpers'
+ end
+
+ module Encryptors
+ autoload :AuthlogicSha512, 'devise/encryptors/authlogic_sha512'
+ autoload :AuthlogicSha1, 'devise/encryptors/authlogic_sha1'
+ autoload :RestfulAuthenticationSha1, 'devise/encryptors/restful_authentication_sha1'
+ autoload :Sha512, 'devise/encryptors/sha512'
+ autoload :Sha1, 'devise/encryptors/sha1'
+ end
+
+ module Orm
+ autoload :ActiveRecord, 'devise/orm/active_record'
+ autoload :DataMapper, 'devise/orm/data_mapper'
+ autoload :MongoMapper, 'devise/orm/mongo_mapper'
+ end
ALL = [:authenticatable, :confirmable, :recoverable, :rememberable,
:timeoutable, :trackable, :validatable]
@@ -147,8 +168,4 @@ def friendly_token
# Set the default_scope to nil, so it's overwritten when the first route is declared.
Warden::Manager.default_scope = nil
-
-require 'devise/controllers'
-require 'devise/encryptors'
-require 'devise/orm'
require 'devise/rails'
@@ -1,7 +0,0 @@
-module Devise
- module Controllers
- autoload :Filters, 'devise/controllers/filters'
- autoload :Helpers, 'devise/controllers/helpers'
- autoload :UrlHelpers, 'devise/controllers/url_helpers'
- end
-end
View
@@ -1,9 +0,0 @@
-module Devise
- module Encryptors
- autoload :AuthlogicSha512, 'devise/encryptors/authlogic_sha512'
- autoload :AuthlogicSha1, 'devise/encryptors/authlogic_sha1'
- autoload :RestfulAuthenticationSha1, 'devise/encryptors/restful_authentication_sha1'
- autoload :Sha512, 'devise/encryptors/sha512'
- autoload :Sha1, 'devise/encryptors/sha1'
- end
-end
View
@@ -1,7 +0,0 @@
-module Devise
- module Orm
- autoload :ActiveRecord, 'devise/orm/active_record'
- autoload :DataMapper, 'devise/orm/data_mapper'
- autoload :MongoMapper, 'devise/orm/mongo_mapper'
- end
-end

0 comments on commit 3432c9e

Please sign in to comment.