Skip to content

Commit

Permalink
whitespace changes
Browse files Browse the repository at this point in the history
  • Loading branch information
technoweenie committed Aug 25, 2008
1 parent 2d24dae commit d98878e
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 27 deletions.
10 changes: 5 additions & 5 deletions lib/authentication.rb
Expand Up @@ -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
Expand All @@ -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
9 changes: 3 additions & 6 deletions lib/authentication/by_cookie_token.rb
Expand Up @@ -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
Expand All @@ -12,7 +12,7 @@ def self.included( recipient )
#
# Class Methods
#
module ModelClassMethods
module ModelClassMethods
end # class methods

#
Expand Down Expand Up @@ -59,10 +59,7 @@ def forget_me
end
end # instance methods
end


#
#
module ByCookieTokenController
# Stuff directives into including module
def self.included( recipient )
Expand Down
5 changes: 2 additions & 3 deletions lib/authentication/by_password.rb
@@ -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

Expand Down
5 changes: 2 additions & 3 deletions lib/authorization.rb
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions lib/authorization/aasm_roles.rb
@@ -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 )
Expand Down Expand Up @@ -42,7 +42,6 @@ def self.included( recipient )
end

module StatefulRolesClassMethods

end # class methods

module StatefulRolesInstanceMethods
Expand Down
3 changes: 1 addition & 2 deletions lib/authorization/stateful_roles.rb
@@ -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 )
Expand Down Expand Up @@ -41,7 +41,6 @@ def self.included( recipient )
end

module StatefulRolesClassMethods

end # class methods

module StatefulRolesInstanceMethods
Expand Down
5 changes: 2 additions & 3 deletions lib/trustification.rb
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/trustification/email_validation.rb
@@ -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
Expand Down

0 comments on commit d98878e

Please sign in to comment.