lib/devise.rb in devise-2.1.4 vs lib/devise.rb in devise-2.2.0.rc
- old
+ new
@@ -4,15 +4,16 @@
require 'orm_adapter'
require 'set'
require 'securerandom'
module Devise
- autoload :Delegator, 'devise/delegator'
- autoload :FailureApp, 'devise/failure_app'
- autoload :OmniAuth, 'devise/omniauth'
- autoload :ParamFilter, 'devise/param_filter'
- autoload :TestHelpers, 'devise/test_helpers'
+ autoload :Delegator, 'devise/delegator'
+ autoload :FailureApp, 'devise/failure_app'
+ autoload :OmniAuth, 'devise/omniauth'
+ autoload :ParamFilter, 'devise/param_filter'
+ autoload :TestHelpers, 'devise/test_helpers'
+ autoload :TimeInflector, 'devise/time_inflector'
module Controllers
autoload :Helpers, 'devise/controllers/helpers'
autoload :Rememberable, 'devise/controllers/rememberable'
autoload :ScopedViews, 'devise/controllers/scoped_views'
@@ -84,11 +85,11 @@
# Email regex used to validate email formats. It simply asserts that
# an one (and only one) @ exists in the given string. This is mainly
# to give user feedback and not to assert the e-mail validity.
mattr_accessor :email_regexp
- @@email_regexp = /\A[^@]+@([^@\.]+\.)+[^@\.]+\z/
+ @@email_regexp = /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/
# Range validation for password length
mattr_accessor :password_length
@@password_length = 6..128
@@ -102,10 +103,14 @@
# Time interval you can access your account before confirming your account.
mattr_accessor :allow_unconfirmed_access_for
@@allow_unconfirmed_access_for = 0.days
+ # Time interval the confirmation token is valid. nil = unlimited
+ mattr_accessor :confirm_within
+ @@confirm_within = nil
+
# Defines which key will be used when confirming an account.
mattr_accessor :confirmation_keys
@@confirmation_keys = [ :email ]
# Defines if email should be reconfirmable.
@@ -197,10 +202,10 @@
# The router Devise should use to generate routes. Defaults
# to :main_app. Should be overriden by engines in order
# to provide custom routes.
mattr_accessor :router_name
@@router_name = nil
-
+
# Set the omniauth path prefix so it can be overriden when
# Devise is used in a mountable engine
mattr_accessor :omniauth_path_prefix
@@omniauth_path_prefix = nil