dm-devise 1.5.0.beta → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.rdoc CHANGED
@@ -1,4 +1,4 @@
1
- == 1.5.0.beta
1
+ == 1.5.0
2
2
 
3
3
  * enhancements
4
4
  * determine validation library extensions to load based on which validation
@@ -6,6 +6,7 @@
6
6
  * Add data_mapper_validation_messages config option so that default messages
7
7
  can be overriden.
8
8
  * Add data_mapper:devise_install generator with dm-devise related options
9
+ * Verify compatibility with DM 1.2.0.rc1 and Rails 1.3.0
9
10
 
10
11
  == 1.4.0
11
12
 
data/Gemfile CHANGED
@@ -10,10 +10,10 @@ group :test do
10
10
  gem 'mocha', :require => false
11
11
  end
12
12
 
13
- DM_VERSION = '~> 1.1.0'
13
+ DM_VERSION = '~> 1.2.0.rc1'
14
14
 
15
15
  group :development do
16
- gem 'rails', '~> 3.0.4'
16
+ gem 'rails', '~> 3.1.0'
17
17
  gem 'dm-sqlite-adapter', DM_VERSION
18
18
 
19
19
  gem 'dm-core', DM_VERSION
data/Gemfile.lock CHANGED
@@ -1,98 +1,105 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dm-devise (1.5.0.beta)
4
+ dm-devise (1.5.0)
5
5
  devise (~> 1.3)
6
- dm-core (>= 1.0.2, < 1.2)
7
- dm-migrations (>= 1.0.2, < 1.2)
8
- dm-rails (>= 1.0.3, < 1.2)
9
- dm-serializer (>= 1.0.2, < 1.2)
10
- dm-timestamps (>= 1.0.2, < 1.2)
6
+ dm-core (>= 1.0.2, < 1.3)
7
+ dm-migrations (>= 1.0.2, < 1.3)
8
+ dm-rails (>= 1.0.3, < 1.3)
9
+ dm-serializer (>= 1.0.2, < 1.3)
10
+ dm-timestamps (>= 1.0.2, < 1.3)
11
11
 
12
12
  GEM
13
13
  remote: http://rubygems.org/
14
14
  specs:
15
- abstract (1.0.0)
16
- actionmailer (3.0.9)
17
- actionpack (= 3.0.9)
18
- mail (~> 2.2.19)
19
- actionpack (3.0.9)
20
- activemodel (= 3.0.9)
21
- activesupport (= 3.0.9)
22
- builder (~> 2.1.2)
23
- erubis (~> 2.6.6)
24
- i18n (~> 0.5.0)
25
- rack (~> 1.2.1)
26
- rack-mount (~> 0.6.14)
27
- rack-test (~> 0.5.7)
28
- tzinfo (~> 0.3.23)
29
- activemodel (3.0.9)
30
- activesupport (= 3.0.9)
31
- builder (~> 2.1.2)
32
- i18n (~> 0.5.0)
33
- activerecord (3.0.9)
34
- activemodel (= 3.0.9)
35
- activesupport (= 3.0.9)
36
- arel (~> 2.0.10)
37
- tzinfo (~> 0.3.23)
38
- activeresource (3.0.9)
39
- activemodel (= 3.0.9)
40
- activesupport (= 3.0.9)
41
- activesupport (3.0.9)
15
+ actionmailer (3.1.0)
16
+ actionpack (= 3.1.0)
17
+ mail (~> 2.3.0)
18
+ actionpack (3.1.0)
19
+ activemodel (= 3.1.0)
20
+ activesupport (= 3.1.0)
21
+ builder (~> 3.0.0)
22
+ erubis (~> 2.7.0)
23
+ i18n (~> 0.6)
24
+ rack (~> 1.3.2)
25
+ rack-cache (~> 1.0.3)
26
+ rack-mount (~> 0.8.2)
27
+ rack-test (~> 0.6.1)
28
+ sprockets (~> 2.0.0)
29
+ activemodel (3.1.0)
30
+ activesupport (= 3.1.0)
31
+ bcrypt-ruby (~> 3.0.0)
32
+ builder (~> 3.0.0)
33
+ i18n (~> 0.6)
34
+ activerecord (3.1.0)
35
+ activemodel (= 3.1.0)
36
+ activesupport (= 3.1.0)
37
+ arel (~> 2.2.1)
38
+ tzinfo (~> 0.3.29)
39
+ activeresource (3.1.0)
40
+ activemodel (= 3.1.0)
41
+ activesupport (= 3.1.0)
42
+ activesupport (3.1.0)
43
+ multi_json (~> 1.0)
42
44
  addressable (2.2.6)
43
- arel (2.0.10)
44
- bcrypt-ruby (2.1.4)
45
- builder (2.1.2)
45
+ arel (2.2.1)
46
+ bcrypt-ruby (3.0.0)
47
+ builder (3.0.0)
46
48
  data_objects (0.10.6)
47
49
  addressable (~> 2.1)
48
- devise (1.4.2)
49
- bcrypt-ruby (~> 2.1.2)
50
+ devise (1.4.5)
51
+ bcrypt-ruby (~> 3.0)
50
52
  orm_adapter (~> 0.0.3)
51
53
  warden (~> 1.0.3)
52
- dm-active_model (1.1.0)
53
- activemodel (~> 3.0.4)
54
- dm-core (~> 1.1.0)
55
- dm-core (1.1.0)
56
- addressable (~> 2.2.4)
57
- dm-do-adapter (1.1.0)
58
- data_objects (~> 0.10.2)
59
- dm-core (~> 1.1.0)
60
- dm-migrations (1.1.0)
61
- dm-core (~> 1.1.0)
62
- dm-rails (1.1.0)
63
- actionpack (~> 3.0.4)
64
- dm-active_model (~> 1.1.0)
65
- dm-core (~> 1.1.0)
66
- railties (~> 3.0.4)
67
- dm-serializer (1.1.0)
68
- dm-core (~> 1.1.0)
54
+ dm-active_model (1.2.0.rc1)
55
+ activemodel (~> 3.1.0)
56
+ dm-core (~> 1.2.0.rc1)
57
+ dm-core (1.2.0.rc1)
58
+ addressable (~> 2.2.6)
59
+ dm-do-adapter (1.2.0.rc1)
60
+ data_objects (~> 0.10.6)
61
+ dm-core (~> 1.2.0.rc1)
62
+ dm-migrations (1.2.0.rc1)
63
+ dm-core (~> 1.2.0.rc1)
64
+ dm-rails (1.2.0.rc1)
65
+ actionpack (~> 3.1.0)
66
+ dm-active_model (~> 1.2.0.rc1)
67
+ dm-core (~> 1.2.0.rc1)
68
+ railties (~> 3.1.0)
69
+ dm-serializer (1.2.0.rc1)
70
+ dm-core (~> 1.2.0.rc1)
69
71
  fastercsv (~> 1.5.4)
70
- json (~> 1.4.6)
71
- dm-sqlite-adapter (1.1.0)
72
- dm-do-adapter (~> 1.1.0)
73
- do_sqlite3 (~> 0.10.2)
74
- dm-timestamps (1.1.0)
75
- dm-core (~> 1.1.0)
76
- dm-validations (1.1.0)
77
- dm-core (~> 1.1.0)
72
+ json (~> 1.5.4)
73
+ json_pure (~> 1.5.4)
74
+ multi_json (~> 1.0.3)
75
+ dm-sqlite-adapter (1.2.0.rc1)
76
+ dm-do-adapter (~> 1.2.0.rc1)
77
+ do_sqlite3 (~> 0.10.6)
78
+ dm-timestamps (1.2.0.rc1)
79
+ dm-core (~> 1.2.0.rc1)
80
+ dm-validations (1.2.0.rc1)
81
+ dm-core (~> 1.2.0.rc1)
78
82
  do_sqlite3 (0.10.6)
79
83
  data_objects (= 0.10.6)
80
- erubis (2.6.6)
81
- abstract (>= 1.0.0)
84
+ erubis (2.7.0)
82
85
  faraday (0.6.1)
83
86
  addressable (~> 2.2.4)
84
87
  multipart-post (~> 1.1.0)
85
88
  rack (< 2, >= 1.1.0)
86
89
  fastercsv (1.5.4)
87
- i18n (0.5.0)
88
- json (1.4.6)
89
- mail (2.2.19)
90
- activesupport (>= 2.3.6)
90
+ hike (1.2.1)
91
+ i18n (0.6.0)
92
+ json (1.5.4)
93
+ json_pure (1.5.4)
94
+ spruz (~> 0.2.8)
95
+ mail (2.3.0)
91
96
  i18n (>= 0.4.0)
92
97
  mime-types (~> 1.16)
93
98
  treetop (~> 1.4.8)
99
+ metaclass (0.0.1)
94
100
  mime-types (1.16)
95
- mocha (0.9.12)
101
+ mocha (0.10.0)
102
+ metaclass (~> 0.0.1)
96
103
  multi_json (1.0.3)
97
104
  multi_xml (0.2.2)
98
105
  multipart-post (1.1.3)
@@ -115,34 +122,45 @@ GEM
115
122
  multi_json (>= 0.0.5)
116
123
  orm_adapter (0.0.5)
117
124
  polyglot (0.3.2)
118
- rack (1.2.3)
119
- rack-mount (0.6.14)
125
+ rack (1.3.2)
126
+ rack-cache (1.0.3)
127
+ rack (>= 0.4)
128
+ rack-mount (0.8.3)
120
129
  rack (>= 1.0.0)
121
130
  rack-openid (1.3.1)
122
131
  rack (>= 1.1.0)
123
132
  ruby-openid (>= 2.1.8)
124
- rack-test (0.5.7)
133
+ rack-ssl (1.3.2)
134
+ rack
135
+ rack-test (0.6.1)
125
136
  rack (>= 1.0)
126
- rails (3.0.9)
127
- actionmailer (= 3.0.9)
128
- actionpack (= 3.0.9)
129
- activerecord (= 3.0.9)
130
- activeresource (= 3.0.9)
131
- activesupport (= 3.0.9)
137
+ rails (3.1.0)
138
+ actionmailer (= 3.1.0)
139
+ actionpack (= 3.1.0)
140
+ activerecord (= 3.1.0)
141
+ activeresource (= 3.1.0)
142
+ activesupport (= 3.1.0)
132
143
  bundler (~> 1.0)
133
- railties (= 3.0.9)
134
- railties (3.0.9)
135
- actionpack (= 3.0.9)
136
- activesupport (= 3.0.9)
144
+ railties (= 3.1.0)
145
+ railties (3.1.0)
146
+ actionpack (= 3.1.0)
147
+ activesupport (= 3.1.0)
148
+ rack-ssl (~> 1.3.2)
137
149
  rake (>= 0.8.7)
138
150
  rdoc (~> 3.4)
139
- thor (~> 0.14.4)
151
+ thor (~> 0.14.6)
140
152
  rake (0.9.2)
141
- rdoc (3.8)
153
+ rdoc (3.9.4)
142
154
  ruby-openid (2.1.8)
143
155
  ruby-openid-apps-discovery (1.2.0)
144
156
  ruby-openid (>= 2.1.7)
157
+ sprockets (2.0.0)
158
+ hike (~> 1.2)
159
+ rack (~> 1.0)
160
+ tilt (!= 1.3.0, ~> 1.1)
161
+ spruz (0.2.13)
145
162
  thor (0.14.6)
163
+ tilt (1.3.3)
146
164
  treetop (1.4.10)
147
165
  polyglot
148
166
  polyglot (>= 0.3.1)
@@ -158,16 +176,16 @@ PLATFORMS
158
176
  ruby
159
177
 
160
178
  DEPENDENCIES
161
- dm-core (~> 1.1.0)
179
+ dm-core (~> 1.2.0.rc1)
162
180
  dm-devise!
163
- dm-migrations (~> 1.1.0)
164
- dm-rails (~> 1.1.0)
165
- dm-serializer (~> 1.1.0)
166
- dm-sqlite-adapter (~> 1.1.0)
167
- dm-timestamps (~> 1.1.0)
168
- dm-validations (~> 1.1.0)
181
+ dm-migrations (~> 1.2.0.rc1)
182
+ dm-rails (~> 1.2.0.rc1)
183
+ dm-serializer (~> 1.2.0.rc1)
184
+ dm-sqlite-adapter (~> 1.2.0.rc1)
185
+ dm-timestamps (~> 1.2.0.rc1)
186
+ dm-validations (~> 1.2.0.rc1)
169
187
  mocha
170
188
  oa-oauth (~> 0.2.0)
171
189
  oa-openid (~> 0.2.0)
172
- rails (~> 3.0.4)
190
+ rails (~> 3.1.0)
173
191
  webrat (= 0.7.2)
data/README.rdoc CHANGED
@@ -10,8 +10,8 @@ earlier versions, but it's not been tested (if you try, please let Jared Morgan
10
10
  This README only covers dm-devise specifics. Make sure to read the devise
11
11
  README http://github.com/plataformatec/devise/blob/master/README.rdoc
12
12
 
13
- Last tested against devise master: 2011-08-02, commit 919404df53a0ee9a8c5be50a3d74acf10ac2e38c
14
- Last tested against devise release 1.4.2
13
+ Last tested against devise master: 2011-09-09, commit ea7f15917f70b82d1ddc9559db968894f2c82cad
14
+ Last tested against devise release 1.4.5
15
15
 
16
16
  == Installation
17
17
 
@@ -23,7 +23,7 @@ Add dm-devise and dm gems to your Gemfile. The following gems are required:
23
23
  gem 'dm-timestamps', '~> 1.1.0'
24
24
  gem 'dm-rails', '~> 1.1.0'
25
25
  gem 'dm-validations', '~> 1.1.0' # Do not include if using data_mapper_active_model
26
- gem 'dm-devise', '~> 1.5.0.beta'
26
+ gem 'dm-devise', '~> 1.5.0'
27
27
 
28
28
  If you're using Active Model validations, do not include dm-validations in your
29
29
  Gemfile.
data/dm-devise.gemspec CHANGED
@@ -16,10 +16,10 @@ Gem::Specification.new do |s|
16
16
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
17
  s.require_paths = ["lib"]
18
18
 
19
- s.add_dependency('dm-core', '>= 1.0.2', '< 1.2')
20
- s.add_dependency('dm-migrations', '>= 1.0.2', '< 1.2')
21
- s.add_dependency('dm-serializer', '>= 1.0.2', '< 1.2')
22
- s.add_dependency('dm-timestamps', '>= 1.0.2', '< 1.2')
23
- s.add_dependency('dm-rails', '>= 1.0.3', '< 1.2')
19
+ s.add_dependency('dm-core', '>= 1.0.2', '< 1.3')
20
+ s.add_dependency('dm-migrations', '>= 1.0.2', '< 1.3')
21
+ s.add_dependency('dm-serializer', '>= 1.0.2', '< 1.3')
22
+ s.add_dependency('dm-timestamps', '>= 1.0.2', '< 1.3')
23
+ s.add_dependency('dm-rails', '>= 1.0.3', '< 1.3')
24
24
  s.add_dependency('devise', '~> 1.3')
25
25
  end
@@ -1,5 +1,5 @@
1
1
  module DataMapper
2
2
  module Devise
3
- VERSION = '1.5.0.beta'.freeze
3
+ VERSION = '1.5.0'.freeze
4
4
  end
5
5
  end
@@ -141,6 +141,17 @@ class SerializableTest < ActiveSupport::TestCase
141
141
  end
142
142
  end
143
143
 
144
+ class AuthenticationOthersTest < ActionController::IntegrationTest
145
+ undef test_sign_in_stub_in_xml_format
146
+
147
+ # In this test, password is nil. AR's serializer adds an attribute specifying
148
+ # it is nil, while dm-serializer removes the property altogether.
149
+ test 'sign in stub in xml format' do
150
+ get new_user_session_path(:format => 'xml')
151
+ assert_equal "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<user>\n <email></email>\n</user>\n", response.body
152
+ end
153
+ end
154
+
144
155
  class DeviseHelperTest < ActionController::IntegrationTest
145
156
  # Ensure test finds the translation of the model name.
146
157
  setup do
@@ -33,4 +33,21 @@ if VALIDATION_LIB == 'dm-validations'
33
33
  assert_equal 'must be between 6 and 128 characters long', user.errors[:password].join
34
34
  end
35
35
  end
36
+
37
+ class ActiveRecordTest < ActiveSupport::TestCase
38
+ undef test_validations_options_are_not_applied_too_late
39
+
40
+ test 'validations options are not applied too late' do
41
+ validators = WithValidation.validators.contexts[:default].select{|validator| validator.field_name == :password}
42
+ length = validators.find { |v| v.class.name == 'DataMapper::Validations::LengthValidator' }
43
+ assert_equal (2..6), length.options[:within]
44
+ end
45
+
46
+ undef test_validations_are_applied_just_once
47
+
48
+ test 'validations are applied just once' do
49
+ validators = Several.validators.contexts[:default].select{|validator| validator.field_name == :password}
50
+ assert_equal 1, validators.select{ |v| v.kind_of?(DataMapper::Validations::LengthValidator) }.length
51
+ end
52
+ end
36
53
  end
@@ -9,6 +9,13 @@ class User
9
9
  property :confirmation_token, String, :writer => :private
10
10
  timestamps :at
11
11
 
12
+ class << self
13
+ # attr_accessible is used by SharedUser. Instead of trying to make a
14
+ # a compatibility method, ignore it and set writer option to private on
15
+ # confirmation_token property.
16
+ def attr_accessible(*args); nil; end
17
+ end
18
+
12
19
  include SharedUser
13
20
  include Shim
14
21
 
@@ -26,3 +33,10 @@ class User
26
33
  end
27
34
  end
28
35
  end
36
+
37
+ # Define UserWithValidation here (instead of waiting for definition in
38
+ # devise/test/models_test.rb) to ensure it is finalized. Otherwise,
39
+ # DatabaseAuthenticatableTest 'should run validations even when current password is invalid or blank' fails.
40
+ class UserWithValidation < User
41
+ validates_presence_of :username
42
+ end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-devise
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31098233
5
- prerelease: 6
4
+ hash: 3
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
9
  - 0
10
- - beta
11
- version: 1.5.0.beta
10
+ version: 1.5.0
12
11
  platform: ruby
13
12
  authors:
14
13
  - Jared Morgan
@@ -16,7 +15,7 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2011-08-03 00:00:00 -05:00
18
+ date: 2011-09-09 00:00:00 -05:00
20
19
  default_executable:
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
@@ -35,11 +34,11 @@ dependencies:
35
34
  version: 1.0.2
36
35
  - - <
37
36
  - !ruby/object:Gem::Version
38
- hash: 11
37
+ hash: 9
39
38
  segments:
40
39
  - 1
41
- - 2
42
- version: "1.2"
40
+ - 3
41
+ version: "1.3"
43
42
  type: :runtime
44
43
  version_requirements: *id001
45
44
  - !ruby/object:Gem::Dependency
@@ -58,11 +57,11 @@ dependencies:
58
57
  version: 1.0.2
59
58
  - - <
60
59
  - !ruby/object:Gem::Version
61
- hash: 11
60
+ hash: 9
62
61
  segments:
63
62
  - 1
64
- - 2
65
- version: "1.2"
63
+ - 3
64
+ version: "1.3"
66
65
  type: :runtime
67
66
  version_requirements: *id002
68
67
  - !ruby/object:Gem::Dependency
@@ -81,11 +80,11 @@ dependencies:
81
80
  version: 1.0.2
82
81
  - - <
83
82
  - !ruby/object:Gem::Version
84
- hash: 11
83
+ hash: 9
85
84
  segments:
86
85
  - 1
87
- - 2
88
- version: "1.2"
86
+ - 3
87
+ version: "1.3"
89
88
  type: :runtime
90
89
  version_requirements: *id003
91
90
  - !ruby/object:Gem::Dependency
@@ -104,11 +103,11 @@ dependencies:
104
103
  version: 1.0.2
105
104
  - - <
106
105
  - !ruby/object:Gem::Version
107
- hash: 11
106
+ hash: 9
108
107
  segments:
109
108
  - 1
110
- - 2
111
- version: "1.2"
109
+ - 3
110
+ version: "1.3"
112
111
  type: :runtime
113
112
  version_requirements: *id004
114
113
  - !ruby/object:Gem::Dependency
@@ -127,11 +126,11 @@ dependencies:
127
126
  version: 1.0.3
128
127
  - - <
129
128
  - !ruby/object:Gem::Version
130
- hash: 11
129
+ hash: 9
131
130
  segments:
132
131
  - 1
133
- - 2
134
- version: "1.2"
132
+ - 3
133
+ version: "1.3"
135
134
  type: :runtime
136
135
  version_requirements: *id005
137
136
  - !ruby/object:Gem::Dependency
@@ -212,14 +211,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
212
211
  required_rubygems_version: !ruby/object:Gem::Requirement
213
212
  none: false
214
213
  requirements:
215
- - - ">"
214
+ - - ">="
216
215
  - !ruby/object:Gem::Version
217
- hash: 25
216
+ hash: 3
218
217
  segments:
219
- - 1
220
- - 3
221
- - 1
222
- version: 1.3.1
218
+ - 0
219
+ version: "0"
223
220
  requirements: []
224
221
 
225
222
  rubyforge_project: