authlogic 2.1.11 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of authlogic might be problematic. Click here for more details.

Files changed (69) hide show
  1. data/Gemfile +9 -1
  2. data/Gemfile.lock +39 -15
  3. data/LICENSE +1 -1
  4. data/README.rdoc +19 -8
  5. data/Rakefile +19 -0
  6. data/VERSION.yml +4 -4
  7. data/authlogic.gemspec +214 -18
  8. data/lib/authlogic/acts_as_authentic/email.rb +12 -12
  9. data/lib/authlogic/acts_as_authentic/logged_in_status.rb +2 -2
  10. data/lib/authlogic/acts_as_authentic/login.rb +14 -14
  11. data/lib/authlogic/acts_as_authentic/password.rb +2 -2
  12. data/lib/authlogic/acts_as_authentic/perishable_token.rb +15 -15
  13. data/lib/authlogic/acts_as_authentic/persistence_token.rb +1 -1
  14. data/lib/authlogic/acts_as_authentic/session_maintenance.rb +2 -15
  15. data/lib/authlogic/authenticates_many/base.rb +3 -4
  16. data/lib/authlogic/controller_adapters/sinatra_adapter.rb +1 -1
  17. data/lib/authlogic/regex.rb +8 -9
  18. data/lib/authlogic/session/active_record_trickery.rb +9 -1
  19. data/lib/authlogic/session/callbacks.rb +1 -1
  20. data/lib/authlogic/session/cookies.rb +15 -15
  21. data/lib/authlogic/session/foundation.rb +8 -0
  22. data/lib/authlogic/session/validation.rb +2 -2
  23. data/lib/generators/authlogic/USAGE +8 -0
  24. data/lib/generators/authlogic/session_generator.rb +14 -0
  25. data/lib/generators/authlogic/templates/session.rb +2 -0
  26. data/test/acts_as_authentic_test/base_test.rb +1 -1
  27. data/test/acts_as_authentic_test/email_test.rb +26 -22
  28. data/test/acts_as_authentic_test/logged_in_status_test.rb +1 -1
  29. data/test/acts_as_authentic_test/login_test.rb +21 -21
  30. data/test/acts_as_authentic_test/magic_columns_test.rb +1 -1
  31. data/test/acts_as_authentic_test/password_test.rb +1 -1
  32. data/test/acts_as_authentic_test/perishable_token_test.rb +1 -1
  33. data/test/acts_as_authentic_test/persistence_token_test.rb +1 -1
  34. data/test/acts_as_authentic_test/restful_authentication_test.rb +1 -1
  35. data/test/acts_as_authentic_test/session_maintenance_test.rb +1 -1
  36. data/test/acts_as_authentic_test/single_access_test.rb +1 -1
  37. data/test/authenticates_many_test.rb +1 -1
  38. data/test/crypto_provider_test/aes256_test.rb +1 -1
  39. data/test/crypto_provider_test/bcrypt_test.rb +1 -1
  40. data/test/crypto_provider_test/sha1_test.rb +1 -1
  41. data/test/crypto_provider_test/sha256_test.rb +1 -1
  42. data/test/crypto_provider_test/sha512_test.rb +1 -1
  43. data/test/i18n_test.rb +1 -1
  44. data/test/random_test.rb +1 -1
  45. data/test/session_test/activation_test.rb +1 -1
  46. data/test/session_test/active_record_trickery_test.rb +16 -6
  47. data/test/session_test/brute_force_protection_test.rb +1 -1
  48. data/test/session_test/callbacks_test.rb +1 -1
  49. data/test/session_test/cookies_test.rb +43 -21
  50. data/test/session_test/existence_test.rb +1 -1
  51. data/test/session_test/http_auth_test.rb +1 -1
  52. data/test/session_test/id_test.rb +1 -1
  53. data/test/session_test/klass_test.rb +1 -1
  54. data/test/session_test/magic_columns_test.rb +1 -1
  55. data/test/session_test/magic_states_test.rb +1 -1
  56. data/test/session_test/params_test.rb +1 -1
  57. data/test/session_test/password_test.rb +1 -1
  58. data/test/session_test/perishability_test.rb +1 -1
  59. data/test/session_test/persistence_test.rb +1 -1
  60. data/test/session_test/scopes_test.rb +1 -1
  61. data/test/session_test/session_test.rb +1 -1
  62. data/test/session_test/timeout_test.rb +1 -1
  63. data/test/session_test/unauthorized_record_test.rb +1 -1
  64. data/test/session_test/validation_test.rb +1 -1
  65. data/test/test_helper.rb +3 -19
  66. metadata +59 -96
  67. checksums.yaml +0 -7
  68. data/.gitignore +0 -10
  69. data/CHANGELOG.rdoc +0 -345
data/Gemfile CHANGED
@@ -1,2 +1,10 @@
1
1
  source :rubygems
2
- gemspec
2
+
3
+ gem 'activerecord', '~> 3.0.7'
4
+
5
+ group :test do
6
+ gem 'bcrypt-ruby'
7
+ gem 'jeweler'
8
+ gem 'ruby-debug19'
9
+ gem 'sqlite3'
10
+ end
@@ -1,25 +1,49 @@
1
- PATH
2
- remote: .
3
- specs:
4
- authlogic (2.1.9)
5
- activerecord (~> 2.3.0)
6
- activesupport (~> 2.3.0)
7
-
8
1
  GEM
9
2
  remote: http://rubygems.org/
10
3
  specs:
11
- activerecord (2.3.14)
12
- activesupport (= 2.3.14)
13
- activesupport (2.3.14)
14
- bcrypt-ruby (3.0.1)
15
- rake (0.9.2.2)
16
- sqlite3 (1.3.6)
4
+ activemodel (3.0.7)
5
+ activesupport (= 3.0.7)
6
+ builder (~> 2.1.2)
7
+ i18n (~> 0.5.0)
8
+ activerecord (3.0.7)
9
+ activemodel (= 3.0.7)
10
+ activesupport (= 3.0.7)
11
+ arel (~> 2.0.2)
12
+ tzinfo (~> 0.3.23)
13
+ activesupport (3.0.7)
14
+ archive-tar-minitar (0.5.2)
15
+ arel (2.0.9)
16
+ bcrypt-ruby (2.1.4)
17
+ builder (2.1.2)
18
+ columnize (0.3.2)
19
+ git (1.2.5)
20
+ i18n (0.5.0)
21
+ jeweler (1.5.2)
22
+ bundler (~> 1.0.0)
23
+ git (>= 1.2.5)
24
+ rake
25
+ linecache19 (0.5.12)
26
+ ruby_core_source (>= 0.1.4)
27
+ rake (0.8.7)
28
+ ruby-debug-base19 (0.11.25)
29
+ columnize (>= 0.3.1)
30
+ linecache19 (>= 0.5.11)
31
+ ruby_core_source (>= 0.1.4)
32
+ ruby-debug19 (0.11.6)
33
+ columnize (>= 0.3.1)
34
+ linecache19 (>= 0.5.11)
35
+ ruby-debug-base19 (>= 0.11.19)
36
+ ruby_core_source (0.1.5)
37
+ archive-tar-minitar (>= 0.5.2)
38
+ sqlite3 (1.3.3)
39
+ tzinfo (0.3.27)
17
40
 
18
41
  PLATFORMS
19
42
  ruby
20
43
 
21
44
  DEPENDENCIES
22
- authlogic!
45
+ activerecord (~> 3.0.7)
23
46
  bcrypt-ruby
24
- rake
47
+ jeweler
48
+ ruby-debug19
25
49
  sqlite3
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Ben Johnson of Binary Logic
1
+ Copyright (c) 2011 Ben Johnson of Binary Logic
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,7 +1,5 @@
1
1
  = Authlogic
2
2
 
3
- ** This branch supports Rails 2 only! For Rails 3 go to the master branch **
4
-
5
3
  Authlogic is a clean, simple, and unobtrusive ruby authentication solution.
6
4
 
7
5
  A code example can replace a thousand words...
@@ -69,6 +67,7 @@ If you find a bug or a problem please post it in the issues section. If you need
69
67
  * <b>Authlogic OpenID addon:</b> http://github.com/binarylogic/authlogic_openid
70
68
  * <b>Authlogic LDAP addon:</b> http://github.com/binarylogic/authlogic_ldap
71
69
  * <b>Authlogic Facebook Connect:</b> http://github.com/kalasjocke/authlogic_facebook_connect
70
+ * <b>Authlogic Facebook Connect (New JS API):</b> http://github.com/studybyte/authlogic_facebook_connect
72
71
  * <b>Authlogic OAuth (Twitter):</b> http://github.com/jrallison/authlogic_oauth
73
72
  * <b>Authlogic PAM:</b> http://github.com/nbudin/authlogic_pam
74
73
 
@@ -152,7 +151,7 @@ What if your user sessions controller could look just like your other controller
152
151
  def new
153
152
  @user_session = UserSession.new
154
153
  end
155
-
154
+
156
155
  def create
157
156
  @user_session = UserSession.new(params[:user_session])
158
157
  if @user_session.save
@@ -161,7 +160,7 @@ What if your user sessions controller could look just like your other controller
161
160
  render :action => :new
162
161
  end
163
162
  end
164
-
163
+
165
164
  def destroy
166
165
  current_user_session.destroy
167
166
  redirect_to new_user_session_url
@@ -185,13 +184,13 @@ Or how about persisting the session...
185
184
 
186
185
  class ApplicationController
187
186
  helper_method :current_user_session, :current_user
188
-
187
+
189
188
  private
190
189
  def current_user_session
191
190
  return @current_user_session if defined?(@current_user_session)
192
191
  @current_user_session = UserSession.find
193
192
  end
194
-
193
+
195
194
  def current_user
196
195
  return @current_user if defined?(@current_user)
197
196
  @current_user = current_user_session && current_user_session.user
@@ -200,9 +199,21 @@ Or how about persisting the session...
200
199
 
201
200
  == Install & Use
202
201
 
203
- Add to your Gemfile
202
+ Install the gem / plugin (recommended)
203
+
204
+ From rubyforge:
205
+
206
+ $ sudo gem install authlogic
207
+
208
+ Or from github:
209
+
210
+ $ sudo gem install binarylogic-authlogic
211
+
212
+ Now just add the gem dependency in your projects configuration.
213
+
214
+ Or you can install this as a plugin:
204
215
 
205
- $ gem 'authlogic', '~> 2.1.0'
216
+ script/plugin install git://github.com/binarylogic/authlogic.git
206
217
 
207
218
  == Detailed Setup Tutorial
208
219
 
data/Rakefile CHANGED
@@ -1,5 +1,24 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
+ require 'bundler'
4
+
5
+ Bundler.setup
6
+
7
+ begin
8
+ require 'jeweler'
9
+ Jeweler::Tasks.new do |gem|
10
+ gem.name = "authlogic"
11
+ gem.summary = "A clean, simple, and unobtrusive ruby authentication solution."
12
+ gem.email = "bjohnson@binarylogic.com"
13
+ gem.homepage = "http://github.com/binarylogic/authlogic"
14
+ gem.authors = ["Ben Johnson of Binary Logic"]
15
+ gem.add_bundler_dependencies
16
+ end
17
+ Jeweler::GemcutterTasks.new
18
+ rescue LoadError
19
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
20
+ end
21
+
3
22
  require 'rake/testtask'
4
23
  Rake::TestTask.new(:test) do |test|
5
24
  test.libs << 'test'
@@ -1,5 +1,5 @@
1
- ---
2
- :major: 2
3
- :minor: 1
4
- :patch: 7
1
+ ---
2
+ :major: 3
3
+ :minor: 0
4
+ :patch: 0
5
5
  :build:
@@ -1,24 +1,220 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
1
4
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
5
 
4
6
  Gem::Specification.new do |s|
5
- s.name = "authlogic"
6
- s.version = "2.1.11"
7
- s.platform = Gem::Platform::RUBY
8
- s.authors = ["Ben Johnson"]
9
- s.email = ["bjohnson@binarylogic.com"]
10
- s.homepage = "http://github.com/binarylogic/authlogic"
11
- s.summary = %q{A clean, simple, and unobtrusive ruby authentication solution.}
12
- s.description = %q{A clean, simple, and unobtrusive ruby authentication solution.}
7
+ s.name = %q{authlogic}
8
+ s.version = "3.0.0"
13
9
 
14
- s.add_dependency 'activerecord', '~> 2.3.0'
15
- s.add_dependency 'activesupport', '~> 2.3.0'
16
- s.add_development_dependency 'rake'
17
- s.add_development_dependency 'bcrypt-ruby'
18
- s.add_development_dependency 'sqlite3'
19
-
20
- s.files = `git ls-files`.split("\n")
21
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Ben Johnson of Binary Logic"]
12
+ s.date = %q{2011-04-30}
13
+ s.email = %q{bjohnson@binarylogic.com}
14
+ s.extra_rdoc_files = [
15
+ "LICENSE",
16
+ "README.rdoc"
17
+ ]
18
+ s.files = [
19
+ "Gemfile",
20
+ "Gemfile.lock",
21
+ "LICENSE",
22
+ "README.rdoc",
23
+ "Rakefile",
24
+ "VERSION.yml",
25
+ "authlogic.gemspec",
26
+ "generators/session/session_generator.rb",
27
+ "generators/session/templates/session.rb",
28
+ "init.rb",
29
+ "lib/authlogic.rb",
30
+ "lib/authlogic/acts_as_authentic/base.rb",
31
+ "lib/authlogic/acts_as_authentic/email.rb",
32
+ "lib/authlogic/acts_as_authentic/logged_in_status.rb",
33
+ "lib/authlogic/acts_as_authentic/login.rb",
34
+ "lib/authlogic/acts_as_authentic/magic_columns.rb",
35
+ "lib/authlogic/acts_as_authentic/password.rb",
36
+ "lib/authlogic/acts_as_authentic/perishable_token.rb",
37
+ "lib/authlogic/acts_as_authentic/persistence_token.rb",
38
+ "lib/authlogic/acts_as_authentic/restful_authentication.rb",
39
+ "lib/authlogic/acts_as_authentic/session_maintenance.rb",
40
+ "lib/authlogic/acts_as_authentic/single_access_token.rb",
41
+ "lib/authlogic/acts_as_authentic/validations_scope.rb",
42
+ "lib/authlogic/authenticates_many/association.rb",
43
+ "lib/authlogic/authenticates_many/base.rb",
44
+ "lib/authlogic/controller_adapters/abstract_adapter.rb",
45
+ "lib/authlogic/controller_adapters/merb_adapter.rb",
46
+ "lib/authlogic/controller_adapters/rails_adapter.rb",
47
+ "lib/authlogic/controller_adapters/sinatra_adapter.rb",
48
+ "lib/authlogic/crypto_providers/aes256.rb",
49
+ "lib/authlogic/crypto_providers/bcrypt.rb",
50
+ "lib/authlogic/crypto_providers/md5.rb",
51
+ "lib/authlogic/crypto_providers/sha1.rb",
52
+ "lib/authlogic/crypto_providers/sha256.rb",
53
+ "lib/authlogic/crypto_providers/sha512.rb",
54
+ "lib/authlogic/crypto_providers/wordpress.rb",
55
+ "lib/authlogic/i18n.rb",
56
+ "lib/authlogic/i18n/translator.rb",
57
+ "lib/authlogic/random.rb",
58
+ "lib/authlogic/regex.rb",
59
+ "lib/authlogic/session/activation.rb",
60
+ "lib/authlogic/session/active_record_trickery.rb",
61
+ "lib/authlogic/session/base.rb",
62
+ "lib/authlogic/session/brute_force_protection.rb",
63
+ "lib/authlogic/session/callbacks.rb",
64
+ "lib/authlogic/session/cookies.rb",
65
+ "lib/authlogic/session/existence.rb",
66
+ "lib/authlogic/session/foundation.rb",
67
+ "lib/authlogic/session/http_auth.rb",
68
+ "lib/authlogic/session/id.rb",
69
+ "lib/authlogic/session/klass.rb",
70
+ "lib/authlogic/session/magic_columns.rb",
71
+ "lib/authlogic/session/magic_states.rb",
72
+ "lib/authlogic/session/params.rb",
73
+ "lib/authlogic/session/password.rb",
74
+ "lib/authlogic/session/perishable_token.rb",
75
+ "lib/authlogic/session/persistence.rb",
76
+ "lib/authlogic/session/priority_record.rb",
77
+ "lib/authlogic/session/scopes.rb",
78
+ "lib/authlogic/session/session.rb",
79
+ "lib/authlogic/session/timeout.rb",
80
+ "lib/authlogic/session/unauthorized_record.rb",
81
+ "lib/authlogic/session/validation.rb",
82
+ "lib/authlogic/test_case.rb",
83
+ "lib/authlogic/test_case/mock_controller.rb",
84
+ "lib/authlogic/test_case/mock_cookie_jar.rb",
85
+ "lib/authlogic/test_case/mock_logger.rb",
86
+ "lib/authlogic/test_case/mock_request.rb",
87
+ "lib/authlogic/test_case/rails_request_adapter.rb",
88
+ "lib/generators/authlogic/USAGE",
89
+ "lib/generators/authlogic/session_generator.rb",
90
+ "lib/generators/authlogic/templates/session.rb",
91
+ "rails/init.rb",
92
+ "shoulda_macros/authlogic.rb",
93
+ "test/acts_as_authentic_test/base_test.rb",
94
+ "test/acts_as_authentic_test/email_test.rb",
95
+ "test/acts_as_authentic_test/logged_in_status_test.rb",
96
+ "test/acts_as_authentic_test/login_test.rb",
97
+ "test/acts_as_authentic_test/magic_columns_test.rb",
98
+ "test/acts_as_authentic_test/password_test.rb",
99
+ "test/acts_as_authentic_test/perishable_token_test.rb",
100
+ "test/acts_as_authentic_test/persistence_token_test.rb",
101
+ "test/acts_as_authentic_test/restful_authentication_test.rb",
102
+ "test/acts_as_authentic_test/session_maintenance_test.rb",
103
+ "test/acts_as_authentic_test/single_access_test.rb",
104
+ "test/authenticates_many_test.rb",
105
+ "test/crypto_provider_test/aes256_test.rb",
106
+ "test/crypto_provider_test/bcrypt_test.rb",
107
+ "test/crypto_provider_test/sha1_test.rb",
108
+ "test/crypto_provider_test/sha256_test.rb",
109
+ "test/crypto_provider_test/sha512_test.rb",
110
+ "test/fixtures/companies.yml",
111
+ "test/fixtures/employees.yml",
112
+ "test/fixtures/projects.yml",
113
+ "test/fixtures/users.yml",
114
+ "test/i18n_test.rb",
115
+ "test/libs/affiliate.rb",
116
+ "test/libs/company.rb",
117
+ "test/libs/employee.rb",
118
+ "test/libs/employee_session.rb",
119
+ "test/libs/ldaper.rb",
120
+ "test/libs/ordered_hash.rb",
121
+ "test/libs/project.rb",
122
+ "test/libs/user.rb",
123
+ "test/libs/user_session.rb",
124
+ "test/random_test.rb",
125
+ "test/session_test/activation_test.rb",
126
+ "test/session_test/active_record_trickery_test.rb",
127
+ "test/session_test/brute_force_protection_test.rb",
128
+ "test/session_test/callbacks_test.rb",
129
+ "test/session_test/cookies_test.rb",
130
+ "test/session_test/credentials_test.rb",
131
+ "test/session_test/existence_test.rb",
132
+ "test/session_test/http_auth_test.rb",
133
+ "test/session_test/id_test.rb",
134
+ "test/session_test/klass_test.rb",
135
+ "test/session_test/magic_columns_test.rb",
136
+ "test/session_test/magic_states_test.rb",
137
+ "test/session_test/params_test.rb",
138
+ "test/session_test/password_test.rb",
139
+ "test/session_test/perishability_test.rb",
140
+ "test/session_test/persistence_test.rb",
141
+ "test/session_test/scopes_test.rb",
142
+ "test/session_test/session_test.rb",
143
+ "test/session_test/timeout_test.rb",
144
+ "test/session_test/unauthorized_record_test.rb",
145
+ "test/session_test/validation_test.rb",
146
+ "test/test_helper.rb"
147
+ ]
148
+ s.homepage = %q{http://github.com/binarylogic/authlogic}
23
149
  s.require_paths = ["lib"]
150
+ s.rubygems_version = %q{1.5.2}
151
+ s.summary = %q{A clean, simple, and unobtrusive ruby authentication solution.}
152
+ s.test_files = [
153
+ "test/acts_as_authentic_test/base_test.rb",
154
+ "test/acts_as_authentic_test/email_test.rb",
155
+ "test/acts_as_authentic_test/logged_in_status_test.rb",
156
+ "test/acts_as_authentic_test/login_test.rb",
157
+ "test/acts_as_authentic_test/magic_columns_test.rb",
158
+ "test/acts_as_authentic_test/password_test.rb",
159
+ "test/acts_as_authentic_test/perishable_token_test.rb",
160
+ "test/acts_as_authentic_test/persistence_token_test.rb",
161
+ "test/acts_as_authentic_test/restful_authentication_test.rb",
162
+ "test/acts_as_authentic_test/session_maintenance_test.rb",
163
+ "test/acts_as_authentic_test/single_access_test.rb",
164
+ "test/authenticates_many_test.rb",
165
+ "test/crypto_provider_test/aes256_test.rb",
166
+ "test/crypto_provider_test/bcrypt_test.rb",
167
+ "test/crypto_provider_test/sha1_test.rb",
168
+ "test/crypto_provider_test/sha256_test.rb",
169
+ "test/crypto_provider_test/sha512_test.rb",
170
+ "test/i18n_test.rb",
171
+ "test/libs/affiliate.rb",
172
+ "test/libs/company.rb",
173
+ "test/libs/employee.rb",
174
+ "test/libs/employee_session.rb",
175
+ "test/libs/ldaper.rb",
176
+ "test/libs/ordered_hash.rb",
177
+ "test/libs/project.rb",
178
+ "test/libs/user.rb",
179
+ "test/libs/user_session.rb",
180
+ "test/random_test.rb",
181
+ "test/session_test/activation_test.rb",
182
+ "test/session_test/active_record_trickery_test.rb",
183
+ "test/session_test/brute_force_protection_test.rb",
184
+ "test/session_test/callbacks_test.rb",
185
+ "test/session_test/cookies_test.rb",
186
+ "test/session_test/credentials_test.rb",
187
+ "test/session_test/existence_test.rb",
188
+ "test/session_test/http_auth_test.rb",
189
+ "test/session_test/id_test.rb",
190
+ "test/session_test/klass_test.rb",
191
+ "test/session_test/magic_columns_test.rb",
192
+ "test/session_test/magic_states_test.rb",
193
+ "test/session_test/params_test.rb",
194
+ "test/session_test/password_test.rb",
195
+ "test/session_test/perishability_test.rb",
196
+ "test/session_test/persistence_test.rb",
197
+ "test/session_test/scopes_test.rb",
198
+ "test/session_test/session_test.rb",
199
+ "test/session_test/timeout_test.rb",
200
+ "test/session_test/unauthorized_record_test.rb",
201
+ "test/session_test/validation_test.rb",
202
+ "test/test_helper.rb"
203
+ ]
204
+
205
+ if s.respond_to? :specification_version then
206
+ s.specification_version = 3
207
+
208
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
209
+ s.add_runtime_dependency(%q<activerecord>, ["~> 3.0.7"])
210
+ s.add_runtime_dependency(%q<activerecord>, ["~> 3.0.7"])
211
+ else
212
+ s.add_dependency(%q<activerecord>, ["~> 3.0.7"])
213
+ s.add_dependency(%q<activerecord>, ["~> 3.0.7"])
214
+ end
215
+ else
216
+ s.add_dependency(%q<activerecord>, ["~> 3.0.7"])
217
+ s.add_dependency(%q<activerecord>, ["~> 3.0.7"])
218
+ end
24
219
  end
220
+
@@ -11,7 +11,7 @@ module Authlogic
11
11
  add_acts_as_authentic_module(Methods)
12
12
  end
13
13
  end
14
-
14
+
15
15
  # Configuration to modify how Authlogic handles the email field.
16
16
  module Config
17
17
  # The name of the field that stores email addresses.
@@ -22,7 +22,7 @@ module Authlogic
22
22
  rw_config(:email_field, value, first_column_to_exist(nil, :email, :email_address))
23
23
  end
24
24
  alias_method :email_field=, :email_field
25
-
25
+
26
26
  # Toggles validating the email field or not.
27
27
  #
28
28
  # * <tt>Default:</tt> true
@@ -31,20 +31,20 @@ module Authlogic
31
31
  rw_config(:validate_email_field, value, true)
32
32
  end
33
33
  alias_method :validate_email_field=, :validate_email_field
34
-
34
+
35
35
  # A hash of options for the validates_length_of call for the email field. Allows you to change this however you want.
36
36
  #
37
37
  # <b>Keep in mind this is ruby. I wanted to keep this as flexible as possible, so you can completely replace the hash or
38
38
  # merge options into it. Checkout the convenience function merge_validates_length_of_email_field_options to merge
39
39
  # options.</b>
40
40
  #
41
- # * <tt>Default:</tt> {:within => 6..100}
41
+ # * <tt>Default:</tt> {:maximum => 100}
42
42
  # * <tt>Accepts:</tt> Hash of options accepted by validates_length_of
43
43
  def validates_length_of_email_field_options(value = nil)
44
- rw_config(:validates_length_of_email_field_options, value, {:within => 6..100})
44
+ rw_config(:validates_length_of_email_field_options, value, {:maximum => 100})
45
45
  end
46
46
  alias_method :validates_length_of_email_field_options=, :validates_length_of_email_field_options
47
-
47
+
48
48
  # A convenience function to merge options into the validates_length_of_email_field_options. So intead of:
49
49
  #
50
50
  # self.validates_length_of_email_field_options = validates_length_of_email_field_options.merge(:my_option => my_value)
@@ -55,25 +55,25 @@ module Authlogic
55
55
  def merge_validates_length_of_email_field_options(options = {})
56
56
  self.validates_length_of_email_field_options = validates_length_of_email_field_options.merge(options)
57
57
  end
58
-
58
+
59
59
  # A hash of options for the validates_format_of call for the email field. Allows you to change this however you want.
60
60
  #
61
61
  # <b>Keep in mind this is ruby. I wanted to keep this as flexible as possible, so you can completely replace the hash or
62
62
  # merge options into it. Checkout the convenience function merge_validates_format_of_email_field_options to merge
63
63
  # options.</b>
64
64
  #
65
- # * <tt>Default:</tt> {:with => Authlogic::Regex.email, :message => I18n.t('error_messages.email_invalid', :default => "should look like an email address.")}
65
+ # * <tt>Default:</tt> {:with => Authlogic::Regex.email, :message => lambda {I18n.t('error_messages.email_invalid', :default => "should look like an email address.")}}
66
66
  # * <tt>Accepts:</tt> Hash of options accepted by validates_format_of
67
67
  def validates_format_of_email_field_options(value = nil)
68
68
  rw_config(:validates_format_of_email_field_options, value, {:with => Authlogic::Regex.email, :message => I18n.t('error_messages.email_invalid', :default => "should look like an email address.")})
69
69
  end
70
70
  alias_method :validates_format_of_email_field_options=, :validates_format_of_email_field_options
71
-
71
+
72
72
  # See merge_validates_length_of_email_field_options. The same thing except for validates_format_of_email_field_options.
73
73
  def merge_validates_format_of_email_field_options(options = {})
74
74
  self.validates_format_of_email_field_options = validates_format_of_email_field_options.merge(options)
75
75
  end
76
-
76
+
77
77
  # A hash of options for the validates_uniqueness_of call for the email field. Allows you to change this however you want.
78
78
  #
79
79
  # <b>Keep in mind this is ruby. I wanted to keep this as flexible as possible, so you can completely replace the hash or
@@ -86,13 +86,13 @@ module Authlogic
86
86
  rw_config(:validates_uniqueness_of_email_field_options, value, {:case_sensitive => false, :scope => validations_scope, :if => "#{email_field}_changed?".to_sym})
87
87
  end
88
88
  alias_method :validates_uniqueness_of_email_field_options=, :validates_uniqueness_of_email_field_options
89
-
89
+
90
90
  # See merge_validates_length_of_email_field_options. The same thing except for validates_uniqueness_of_email_field_options.
91
91
  def merge_validates_uniqueness_of_email_field_options(options = {})
92
92
  self.validates_uniqueness_of_email_field_options = validates_uniqueness_of_email_field_options.merge(options)
93
93
  end
94
94
  end
95
-
95
+
96
96
  # All methods relating to the email field
97
97
  module Methods
98
98
  def self.included(klass)