simple_auth 1.5.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -1
  3. data/.travis.yml +11 -0
  4. data/CHANGELOG.md +5 -0
  5. data/Gemfile +0 -2
  6. data/Gemfile.lock +102 -79
  7. data/README.md +243 -0
  8. data/Rakefile +15 -0
  9. data/gemfiles/rails_3_1.gemfile +5 -0
  10. data/gemfiles/rails_3_1.gemfile.lock +151 -0
  11. data/gemfiles/rails_3_2.gemfile +5 -0
  12. data/gemfiles/rails_3_2.gemfile.lock +149 -0
  13. data/gemfiles/rails_4_0.gemfile +4 -0
  14. data/gemfiles/rails_4_0.gemfile.lock +140 -0
  15. data/gemfiles/rails_4_1.gemfile +4 -0
  16. data/gemfiles/rails_4_1.gemfile.lock +146 -0
  17. data/lib/simple_auth.rb +1 -6
  18. data/lib/simple_auth/action_controller.rb +14 -10
  19. data/lib/simple_auth/active_record.rb +86 -0
  20. data/lib/simple_auth/compat.rb +2 -0
  21. data/lib/simple_auth/compat/active_record.rb +31 -0
  22. data/lib/simple_auth/compat/config.rb +17 -0
  23. data/lib/simple_auth/config.rb +0 -20
  24. data/lib/simple_auth/exceptions.rb +0 -1
  25. data/lib/simple_auth/railtie.rb +1 -1
  26. data/lib/simple_auth/rspec.rb +2 -2
  27. data/lib/simple_auth/session.rb +1 -1
  28. data/lib/simple_auth/version.rb +2 -2
  29. data/simple_auth.gemspec +4 -4
  30. data/spec/controllers/redirect_logged_user_spec.rb +16 -16
  31. data/spec/controllers/require_logged_user_spec.rb +34 -34
  32. data/spec/schema.rb +5 -1
  33. data/spec/simple_auth/active_record_spec.rb +104 -2
  34. data/spec/simple_auth/compat_spec.rb +31 -0
  35. data/spec/simple_auth/config_spec.rb +8 -27
  36. data/spec/simple_auth/helper_spec.rb +7 -7
  37. data/spec/simple_auth/session_spec.rb +76 -76
  38. data/spec/spec_helper.rb +2 -168
  39. data/spec/support/app/models/customer.rb +3 -0
  40. data/templates/initializer.rb +0 -8
  41. metadata +62 -33
  42. data/README.markdown +0 -202
  43. data/lib/simple_auth/orm/active_record.rb +0 -80
  44. data/lib/simple_auth/orm/base.rb +0 -89
  45. data/lib/simple_auth/orm/mongo_mapper.rb +0 -62
  46. data/spec/simple_auth/mongo_mapper_spec.rb +0 -10
  47. data/spec/support/app/models/account.rb +0 -6
data/Rakefile CHANGED
@@ -3,3 +3,18 @@ Bundler::GemHelper.install_tasks
3
3
 
4
4
  require "rspec/core/rake_task"
5
5
  RSpec::Core::RakeTask.new
6
+
7
+ desc "Run specs against all gemfiles"
8
+ task "spec:all" do
9
+ %w[
10
+ Gemfile
11
+ gemfiles/rails_3_1.gemfile
12
+ gemfiles/rails_3_2.gemfile
13
+ gemfiles/rails_4_0.gemfile
14
+ gemfiles/rails_4_1.gemfile
15
+ ].each do |gemfile|
16
+ puts "\n=> Running with Gemfile: #{gemfile}"
17
+ system "BUNDLE_GEMFILE=#{gemfile} bundle exec rspec"
18
+ exit 1 unless $?.success?
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+ gemspec path: ".."
3
+
4
+ gem "rails", "~> 3.1.0"
5
+ gem "bcrypt-ruby", "~> 3.0.0"
@@ -0,0 +1,151 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ simple_auth (2.0.0)
5
+ rails (>= 3.1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionmailer (3.1.12)
11
+ actionpack (= 3.1.12)
12
+ mail (~> 2.4.4)
13
+ actionpack (3.1.12)
14
+ activemodel (= 3.1.12)
15
+ activesupport (= 3.1.12)
16
+ builder (~> 3.0.0)
17
+ erubis (~> 2.7.0)
18
+ i18n (~> 0.6)
19
+ rack (~> 1.3.6)
20
+ rack-cache (~> 1.2)
21
+ rack-mount (~> 0.8.2)
22
+ rack-test (~> 0.6.1)
23
+ sprockets (~> 2.0.4)
24
+ activemodel (3.1.12)
25
+ activesupport (= 3.1.12)
26
+ builder (~> 3.0.0)
27
+ i18n (~> 0.6)
28
+ activerecord (3.1.12)
29
+ activemodel (= 3.1.12)
30
+ activesupport (= 3.1.12)
31
+ arel (~> 2.2.3)
32
+ tzinfo (~> 0.3.29)
33
+ activeresource (3.1.12)
34
+ activemodel (= 3.1.12)
35
+ activesupport (= 3.1.12)
36
+ activesupport (3.1.12)
37
+ multi_json (~> 1.0)
38
+ arel (2.2.3)
39
+ awesome_print (1.2.0)
40
+ bcrypt (3.1.7)
41
+ bcrypt-ruby (3.0.1)
42
+ builder (3.0.4)
43
+ coderay (1.1.0)
44
+ columnize (0.3.6)
45
+ debugger (1.6.6)
46
+ columnize (>= 0.3.1)
47
+ debugger-linecache (~> 1.2.0)
48
+ debugger-ruby_core_source (~> 1.3.2)
49
+ debugger-linecache (1.2.0)
50
+ debugger-ruby_core_source (1.3.2)
51
+ diff-lcs (1.2.5)
52
+ erubis (2.7.0)
53
+ hike (1.2.3)
54
+ i18n (0.6.9)
55
+ json (1.8.1)
56
+ mail (2.4.4)
57
+ i18n (>= 0.4.0)
58
+ mime-types (~> 1.16)
59
+ treetop (~> 1.4.8)
60
+ method_source (0.8.2)
61
+ mime-types (1.25.1)
62
+ multi_json (1.9.2)
63
+ polyglot (0.3.4)
64
+ pry (0.9.12.6)
65
+ coderay (~> 1.0)
66
+ method_source (~> 0.8)
67
+ slop (~> 3.4)
68
+ pry-debugger (0.2.2)
69
+ debugger (~> 1.3)
70
+ pry (~> 0.9.10)
71
+ pry-meta (0.0.6)
72
+ awesome_print
73
+ pry
74
+ pry-debugger
75
+ pry-remote
76
+ pry-remote (0.1.8)
77
+ pry (~> 0.9)
78
+ slop (~> 3.0)
79
+ rack (1.3.10)
80
+ rack-cache (1.2)
81
+ rack (>= 0.4)
82
+ rack-mount (0.8.3)
83
+ rack (>= 1.0.0)
84
+ rack-ssl (1.3.3)
85
+ rack
86
+ rack-test (0.6.2)
87
+ rack (>= 1.0)
88
+ rails (3.1.12)
89
+ actionmailer (= 3.1.12)
90
+ actionpack (= 3.1.12)
91
+ activerecord (= 3.1.12)
92
+ activeresource (= 3.1.12)
93
+ activesupport (= 3.1.12)
94
+ bundler (~> 1.0)
95
+ railties (= 3.1.12)
96
+ railties (3.1.12)
97
+ actionpack (= 3.1.12)
98
+ activesupport (= 3.1.12)
99
+ rack-ssl (~> 1.3.2)
100
+ rake (>= 0.8.7)
101
+ rdoc (~> 3.4)
102
+ thor (~> 0.14.6)
103
+ rake (10.3.1)
104
+ rdoc (3.12.2)
105
+ json (~> 1.4)
106
+ rspec-collection_matchers (0.0.3)
107
+ rspec-expectations (>= 2.99.0.beta1)
108
+ rspec-core (3.0.0.beta2)
109
+ rspec-support (= 3.0.0.beta2)
110
+ rspec-expectations (3.0.0.beta2)
111
+ diff-lcs (>= 1.2.0, < 2.0)
112
+ rspec-support (= 3.0.0.beta2)
113
+ rspec-mocks (3.0.0.beta2)
114
+ rspec-support (= 3.0.0.beta2)
115
+ rspec-rails (3.0.0.beta2)
116
+ actionpack (>= 3.0)
117
+ activemodel (>= 3.0)
118
+ activesupport (>= 3.0)
119
+ railties (>= 3.0)
120
+ rspec-collection_matchers
121
+ rspec-core (= 3.0.0.beta2)
122
+ rspec-expectations (= 3.0.0.beta2)
123
+ rspec-mocks (= 3.0.0.beta2)
124
+ rspec-support (= 3.0.0.beta2)
125
+ rspec-support (3.0.0.beta2)
126
+ slop (3.5.0)
127
+ sprockets (2.0.4)
128
+ hike (~> 1.2)
129
+ rack (~> 1.0)
130
+ tilt (~> 1.1, != 1.3.0)
131
+ sqlite3 (1.3.9)
132
+ sqlite3-ruby (1.3.3)
133
+ sqlite3 (>= 1.3.3)
134
+ thor (0.14.6)
135
+ tilt (1.4.1)
136
+ treetop (1.4.15)
137
+ polyglot
138
+ polyglot (>= 0.3.1)
139
+ tzinfo (0.3.39)
140
+
141
+ PLATFORMS
142
+ ruby
143
+
144
+ DEPENDENCIES
145
+ bcrypt (~> 3.1.7)
146
+ bcrypt-ruby (~> 3.0.0)
147
+ pry-meta
148
+ rails (~> 3.1.0)
149
+ rspec-rails (= 3.0.0.beta2)
150
+ simple_auth!
151
+ sqlite3-ruby
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+ gemspec path: ".."
3
+
4
+ gem "rails", "~> 3.2.0"
5
+ gem "bcrypt-ruby", "~> 3.0.0"
@@ -0,0 +1,149 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ simple_auth (2.0.0)
5
+ rails (>= 3.1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionmailer (3.2.17)
11
+ actionpack (= 3.2.17)
12
+ mail (~> 2.5.4)
13
+ actionpack (3.2.17)
14
+ activemodel (= 3.2.17)
15
+ activesupport (= 3.2.17)
16
+ builder (~> 3.0.0)
17
+ erubis (~> 2.7.0)
18
+ journey (~> 1.0.4)
19
+ rack (~> 1.4.5)
20
+ rack-cache (~> 1.2)
21
+ rack-test (~> 0.6.1)
22
+ sprockets (~> 2.2.1)
23
+ activemodel (3.2.17)
24
+ activesupport (= 3.2.17)
25
+ builder (~> 3.0.0)
26
+ activerecord (3.2.17)
27
+ activemodel (= 3.2.17)
28
+ activesupport (= 3.2.17)
29
+ arel (~> 3.0.2)
30
+ tzinfo (~> 0.3.29)
31
+ activeresource (3.2.17)
32
+ activemodel (= 3.2.17)
33
+ activesupport (= 3.2.17)
34
+ activesupport (3.2.17)
35
+ i18n (~> 0.6, >= 0.6.4)
36
+ multi_json (~> 1.0)
37
+ arel (3.0.3)
38
+ awesome_print (1.2.0)
39
+ bcrypt (3.1.7)
40
+ bcrypt-ruby (3.0.1)
41
+ builder (3.0.4)
42
+ coderay (1.1.0)
43
+ columnize (0.3.6)
44
+ debugger (1.6.6)
45
+ columnize (>= 0.3.1)
46
+ debugger-linecache (~> 1.2.0)
47
+ debugger-ruby_core_source (~> 1.3.2)
48
+ debugger-linecache (1.2.0)
49
+ debugger-ruby_core_source (1.3.2)
50
+ diff-lcs (1.2.5)
51
+ erubis (2.7.0)
52
+ hike (1.2.3)
53
+ i18n (0.6.9)
54
+ journey (1.0.4)
55
+ json (1.8.1)
56
+ mail (2.5.4)
57
+ mime-types (~> 1.16)
58
+ treetop (~> 1.4.8)
59
+ method_source (0.8.2)
60
+ mime-types (1.25.1)
61
+ multi_json (1.9.2)
62
+ polyglot (0.3.4)
63
+ pry (0.9.12.6)
64
+ coderay (~> 1.0)
65
+ method_source (~> 0.8)
66
+ slop (~> 3.4)
67
+ pry-debugger (0.2.2)
68
+ debugger (~> 1.3)
69
+ pry (~> 0.9.10)
70
+ pry-meta (0.0.6)
71
+ awesome_print
72
+ pry
73
+ pry-debugger
74
+ pry-remote
75
+ pry-remote (0.1.8)
76
+ pry (~> 0.9)
77
+ slop (~> 3.0)
78
+ rack (1.4.5)
79
+ rack-cache (1.2)
80
+ rack (>= 0.4)
81
+ rack-ssl (1.3.3)
82
+ rack
83
+ rack-test (0.6.2)
84
+ rack (>= 1.0)
85
+ rails (3.2.17)
86
+ actionmailer (= 3.2.17)
87
+ actionpack (= 3.2.17)
88
+ activerecord (= 3.2.17)
89
+ activeresource (= 3.2.17)
90
+ activesupport (= 3.2.17)
91
+ bundler (~> 1.0)
92
+ railties (= 3.2.17)
93
+ railties (3.2.17)
94
+ actionpack (= 3.2.17)
95
+ activesupport (= 3.2.17)
96
+ rack-ssl (~> 1.3.2)
97
+ rake (>= 0.8.7)
98
+ rdoc (~> 3.4)
99
+ thor (>= 0.14.6, < 2.0)
100
+ rake (10.3.1)
101
+ rdoc (3.12.2)
102
+ json (~> 1.4)
103
+ rspec-collection_matchers (0.0.3)
104
+ rspec-expectations (>= 2.99.0.beta1)
105
+ rspec-core (3.0.0.beta2)
106
+ rspec-support (= 3.0.0.beta2)
107
+ rspec-expectations (3.0.0.beta2)
108
+ diff-lcs (>= 1.2.0, < 2.0)
109
+ rspec-support (= 3.0.0.beta2)
110
+ rspec-mocks (3.0.0.beta2)
111
+ rspec-support (= 3.0.0.beta2)
112
+ rspec-rails (3.0.0.beta2)
113
+ actionpack (>= 3.0)
114
+ activemodel (>= 3.0)
115
+ activesupport (>= 3.0)
116
+ railties (>= 3.0)
117
+ rspec-collection_matchers
118
+ rspec-core (= 3.0.0.beta2)
119
+ rspec-expectations (= 3.0.0.beta2)
120
+ rspec-mocks (= 3.0.0.beta2)
121
+ rspec-support (= 3.0.0.beta2)
122
+ rspec-support (3.0.0.beta2)
123
+ slop (3.5.0)
124
+ sprockets (2.2.2)
125
+ hike (~> 1.2)
126
+ multi_json (~> 1.0)
127
+ rack (~> 1.0)
128
+ tilt (~> 1.1, != 1.3.0)
129
+ sqlite3 (1.3.9)
130
+ sqlite3-ruby (1.3.3)
131
+ sqlite3 (>= 1.3.3)
132
+ thor (0.19.1)
133
+ tilt (1.4.1)
134
+ treetop (1.4.15)
135
+ polyglot
136
+ polyglot (>= 0.3.1)
137
+ tzinfo (0.3.39)
138
+
139
+ PLATFORMS
140
+ ruby
141
+
142
+ DEPENDENCIES
143
+ bcrypt (~> 3.1.7)
144
+ bcrypt-ruby (~> 3.0.0)
145
+ pry-meta
146
+ rails (~> 3.2.0)
147
+ rspec-rails (= 3.0.0.beta2)
148
+ simple_auth!
149
+ sqlite3-ruby
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+ gemspec path: ".."
3
+
4
+ gem "rails", "~> 4.0.0"
@@ -0,0 +1,140 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ simple_auth (2.0.0)
5
+ rails (>= 3.1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionmailer (4.0.4)
11
+ actionpack (= 4.0.4)
12
+ mail (~> 2.5.4)
13
+ actionpack (4.0.4)
14
+ activesupport (= 4.0.4)
15
+ builder (~> 3.1.0)
16
+ erubis (~> 2.7.0)
17
+ rack (~> 1.5.2)
18
+ rack-test (~> 0.6.2)
19
+ activemodel (4.0.4)
20
+ activesupport (= 4.0.4)
21
+ builder (~> 3.1.0)
22
+ activerecord (4.0.4)
23
+ activemodel (= 4.0.4)
24
+ activerecord-deprecated_finders (~> 1.0.2)
25
+ activesupport (= 4.0.4)
26
+ arel (~> 4.0.0)
27
+ activerecord-deprecated_finders (1.0.3)
28
+ activesupport (4.0.4)
29
+ i18n (~> 0.6, >= 0.6.9)
30
+ minitest (~> 4.2)
31
+ multi_json (~> 1.3)
32
+ thread_safe (~> 0.1)
33
+ tzinfo (~> 0.3.37)
34
+ arel (4.0.2)
35
+ awesome_print (1.2.0)
36
+ bcrypt (3.1.7)
37
+ builder (3.1.4)
38
+ coderay (1.1.0)
39
+ columnize (0.3.6)
40
+ debugger (1.6.6)
41
+ columnize (>= 0.3.1)
42
+ debugger-linecache (~> 1.2.0)
43
+ debugger-ruby_core_source (~> 1.3.2)
44
+ debugger-linecache (1.2.0)
45
+ debugger-ruby_core_source (1.3.2)
46
+ diff-lcs (1.2.5)
47
+ erubis (2.7.0)
48
+ hike (1.2.3)
49
+ i18n (0.6.9)
50
+ mail (2.5.4)
51
+ mime-types (~> 1.16)
52
+ treetop (~> 1.4.8)
53
+ method_source (0.8.2)
54
+ mime-types (1.25.1)
55
+ minitest (4.7.5)
56
+ multi_json (1.9.2)
57
+ polyglot (0.3.4)
58
+ pry (0.9.12.6)
59
+ coderay (~> 1.0)
60
+ method_source (~> 0.8)
61
+ slop (~> 3.4)
62
+ pry-debugger (0.2.2)
63
+ debugger (~> 1.3)
64
+ pry (~> 0.9.10)
65
+ pry-meta (0.0.6)
66
+ awesome_print
67
+ pry
68
+ pry-debugger
69
+ pry-remote
70
+ pry-remote (0.1.8)
71
+ pry (~> 0.9)
72
+ slop (~> 3.0)
73
+ rack (1.5.2)
74
+ rack-test (0.6.2)
75
+ rack (>= 1.0)
76
+ rails (4.0.4)
77
+ actionmailer (= 4.0.4)
78
+ actionpack (= 4.0.4)
79
+ activerecord (= 4.0.4)
80
+ activesupport (= 4.0.4)
81
+ bundler (>= 1.3.0, < 2.0)
82
+ railties (= 4.0.4)
83
+ sprockets-rails (~> 2.0.0)
84
+ railties (4.0.4)
85
+ actionpack (= 4.0.4)
86
+ activesupport (= 4.0.4)
87
+ rake (>= 0.8.7)
88
+ thor (>= 0.18.1, < 2.0)
89
+ rake (10.3.1)
90
+ rspec-collection_matchers (0.0.3)
91
+ rspec-expectations (>= 2.99.0.beta1)
92
+ rspec-core (3.0.0.beta2)
93
+ rspec-support (= 3.0.0.beta2)
94
+ rspec-expectations (3.0.0.beta2)
95
+ diff-lcs (>= 1.2.0, < 2.0)
96
+ rspec-support (= 3.0.0.beta2)
97
+ rspec-mocks (3.0.0.beta2)
98
+ rspec-support (= 3.0.0.beta2)
99
+ rspec-rails (3.0.0.beta2)
100
+ actionpack (>= 3.0)
101
+ activemodel (>= 3.0)
102
+ activesupport (>= 3.0)
103
+ railties (>= 3.0)
104
+ rspec-collection_matchers
105
+ rspec-core (= 3.0.0.beta2)
106
+ rspec-expectations (= 3.0.0.beta2)
107
+ rspec-mocks (= 3.0.0.beta2)
108
+ rspec-support (= 3.0.0.beta2)
109
+ rspec-support (3.0.0.beta2)
110
+ slop (3.5.0)
111
+ sprockets (2.12.1)
112
+ hike (~> 1.2)
113
+ multi_json (~> 1.0)
114
+ rack (~> 1.0)
115
+ tilt (~> 1.1, != 1.3.0)
116
+ sprockets-rails (2.0.1)
117
+ actionpack (>= 3.0)
118
+ activesupport (>= 3.0)
119
+ sprockets (~> 2.8)
120
+ sqlite3 (1.3.9)
121
+ sqlite3-ruby (1.3.3)
122
+ sqlite3 (>= 1.3.3)
123
+ thor (0.19.1)
124
+ thread_safe (0.3.3)
125
+ tilt (1.4.1)
126
+ treetop (1.4.15)
127
+ polyglot
128
+ polyglot (>= 0.3.1)
129
+ tzinfo (0.3.39)
130
+
131
+ PLATFORMS
132
+ ruby
133
+
134
+ DEPENDENCIES
135
+ bcrypt (~> 3.1.7)
136
+ pry-meta
137
+ rails (~> 4.0.0)
138
+ rspec-rails (= 3.0.0.beta2)
139
+ simple_auth!
140
+ sqlite3-ruby