Permalink
Browse files

whitespace changes

  • Loading branch information...
technoweenie committed Aug 25, 2008
1 parent 2d24dae commit d98878e221c1a6e97e3d086330508ac420bf4ebf
View
@@ -14,15 +14,15 @@ module Authentication
RE_EMAIL_NAME = '[\w\.%\+\-]+' # what you actually see in practice
#RE_EMAIL_NAME = '0-9A-Z!#\$%\&\'\*\+_/=\?^\-`\{|\}~\.' # technically allowed by RFC-2822
RE_DOMAIN_HEAD = '(?:[A-Z0-9\-]+\.)+'
- RE_DOMAIN_TLD = '(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)'
+ RE_DOMAIN_TLD = '(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|edu)'
RE_EMAIL_OK = /\A#{RE_EMAIL_NAME}@#{RE_DOMAIN_HEAD}#{RE_DOMAIN_TLD}\z/i
MSG_EMAIL_BAD = "should look like an email address."
- CONSTANTS_DEFINED = 'yup' # sorry for the C idiom
+ CONSTANTS_DEFINED = true # sorry for the C idiom
end
- def self.included( recipient )
- recipient.extend( ModelClassMethods )
+ def self.included(recipient)
+ recipient.extend(ModelClassMethods)
recipient.class_eval do
include ModelInstanceMethods
end
@@ -32,12 +32,12 @@ module ModelClassMethods
def secure_digest(*args)
Digest::SHA1.hexdigest(args.flatten.join('--'))
end
+
def make_token
secure_digest(Time.now, (1..10).map{ rand.to_s })
end
end # class methods
module ModelInstanceMethods
end # instance methods
-
end
@@ -2,8 +2,8 @@
module Authentication
module ByCookieToken
# Stuff directives into including module
- def self.included( recipient )
- recipient.extend( ModelClassMethods )
+ def self.included(recipient)
+ recipient.extend(ModelClassMethods)
recipient.class_eval do
include ModelInstanceMethods
end
@@ -12,7 +12,7 @@ def self.included( recipient )
#
# Class Methods
#
- module ModelClassMethods
+ module ModelClassMethods
end # class methods
#
@@ -59,10 +59,7 @@ def forget_me
end
end # instance methods
end
-
- #
- #
module ByCookieTokenController
# Stuff directives into including module
def self.included( recipient )
@@ -1,9 +1,8 @@
module Authentication
module ByPassword
-
# Stuff directives into including module
- def self.included( recipient )
- recipient.extend( ModelClassMethods )
+ def self.included(recipient)
+ recipient.extend(ModelClassMethods)
recipient.class_eval do
include ModelInstanceMethods
View
@@ -1,7 +1,6 @@
module Authorization
-
- def self.included( recipient )
- recipient.extend( ModelClassMethods )
+ def self.included(recipient)
+ recipient.extend(ModelClassMethods)
recipient.class_eval do
include ModelInstanceMethods
end
@@ -1,7 +1,7 @@
module Authorization
module AasmRoles
unless Object.constants.include? "STATEFUL_ROLES_CONSTANTS_DEFINED"
- STATEFUL_ROLES_CONSTANTS_DEFINED = 'yup' # sorry for the C idiom
+ STATEFUL_ROLES_CONSTANTS_DEFINED = true # sorry for the C idiom
end
def self.included( recipient )
@@ -42,7 +42,6 @@ def self.included( recipient )
end
module StatefulRolesClassMethods
-
end # class methods
module StatefulRolesInstanceMethods
@@ -1,7 +1,7 @@
module Authorization
module StatefulRoles
unless Object.constants.include? "STATEFUL_ROLES_CONSTANTS_DEFINED"
- STATEFUL_ROLES_CONSTANTS_DEFINED = 'yup' # sorry for the C idiom
+ STATEFUL_ROLES_CONSTANTS_DEFINED = true # sorry for the C idiom
end
def self.included( recipient )
@@ -41,7 +41,6 @@ def self.included( recipient )
end
module StatefulRolesClassMethods
-
end # class methods
module StatefulRolesInstanceMethods
View
@@ -1,7 +1,6 @@
module Trustification
-
- def self.included( recipient )
- recipient.extend( ModelClassMethods )
+ def self.included(recipient)
+ recipient.extend(ModelClassMethods)
recipient.class_eval do
include ModelInstanceMethods
end
@@ -1,11 +1,11 @@
module Trustification
module EmailValidation
unless Object.constants.include? "CONSTANTS_DEFINED"
- CONSTANTS_DEFINED = 'yup' # sorry for the C idiom
+ CONSTANTS_DEFINED = true # sorry for the C idiom
end
- def self.included( recipient )
- recipient.extend( ClassMethods )
+ def self.included(recipient)
+ recipient.extend(ClassMethods)
recipient.class_eval do
include InstanceMethods
end

0 comments on commit d98878e

Please sign in to comment.