roles_mongoid 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -2,16 +2,16 @@ source :rubygems
2
2
  source 'http://gems.github.com/'
3
3
 
4
4
  group :default do
5
- gem "mongoid", '>= 2.0.0.rc.1'
6
- gem 'bson', '>= 1.1.1'
7
- gem "activesupport", '~> 3.0.1'
5
+ gem "mongoid", '~> 2.0.0.rc.5'
6
+ gem 'bson', '>= 1.1.5'
7
+ gem "activesupport", '~> 3.0.3'
8
8
  gem "require_all", '~> 1.2.0'
9
- gem "sugar-high", '>= 0.3.0'
10
- gem "roles_generic", '>= 0.3.2'
11
- gem 'logging_assist', '>= 0.2.0'
9
+ gem "sugar-high", '>= 0.3.5'
10
+ gem "roles_generic", '>= 0.3.6'
11
+ gem 'logging_assist', '>= 0.2.1'
12
12
  end
13
13
 
14
14
  group :test do
15
- gem 'rspec', '>= 2.0.1'
15
+ gem 'rspec', '>= 2.4.0'
16
16
  gem 'generator-spec', '>= 0.7.0'
17
17
  end
data/Rakefile CHANGED
@@ -7,18 +7,18 @@ begin
7
7
  gem.email = "kmandrup@gmail.com"
8
8
  gem.homepage = "http://github.com/kristianmandrup/roles_mongoid"
9
9
  gem.authors = ["Kristian Mandrup"]
10
- gem.add_development_dependency 'rspec', '>= 2.0.1'
10
+ gem.add_development_dependency 'rspec', '>= 2.4.0'
11
11
  gem.add_development_dependency 'generator-spec', '>= 0.7.0'
12
12
 
13
- gem.add_dependency 'mongoid', '>= 2.0.0.rc.1'
14
- gem.add_dependency 'bson', '>= 1.1.4'
13
+ gem.add_dependency 'mongoid', '~> 2.0.0.rc.5'
14
+ gem.add_dependency 'bson', '>= 1.1.5'
15
15
 
16
- gem.add_dependency 'sugar-high', '~> 0.3.1'
16
+ gem.add_dependency 'sugar-high', '~> 0.3.5'
17
17
  gem.add_dependency 'require_all', '~> 1.2.0'
18
- gem.add_dependency "roles_generic", '>= 0.3.3'
18
+ gem.add_dependency "roles_generic", '>= 0.3.6'
19
19
 
20
20
  gem.add_dependency 'rails3_artifactor', '>= 0.3.1'
21
- gem.add_dependency 'logging_assist', '>= 0.2.0'
21
+ gem.add_dependency 'logging_assist', '>= 0.2.1'
22
22
  end
23
23
  Jeweler::GemcutterTasks.new
24
24
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.4
1
+ 0.4.5
@@ -17,8 +17,9 @@ module Roles
17
17
  MAP = {
18
18
  :admin_flag => "field :admin_flag, :type => Boolean",
19
19
 
20
- :many_roles => "references_many :many_roles, :stored_as => :array, :class_name => 'Role'",
21
- :one_role => "referenced_in :one_role, :class_name => 'Role'",
20
+ :many_roles_old => "references_many :many_roles, :stored_as => :array, :class_name => 'Role'",
21
+ :many_roles => "references_and_referenced_in_many :many_roles, :class_name => 'Role'",
22
+ :one_role => "referenced_in :one_role, :class_name => 'Role'",
22
23
 
23
24
  :embed_many_roles => "embeds_many :many_roles, :class_name => 'Role'",
24
25
  :embed_one_role => "embeds_one :one_role, :class_name => 'Role'",
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{roles_mongoid}
8
- s.version = "0.4.4"
8
+ s.version = "0.4.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
12
- s.date = %q{2011-01-10}
12
+ s.date = %q{2011-01-19}
13
13
  s.description = %q{Makes it easy to set a role strategy on your User model in Mongoid}
14
14
  s.email = %q{kmandrup@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -55,6 +55,7 @@ Gem::Specification.new do |s|
55
55
  "spec/roles_mongoid/generators/roles_generator_spec.rb",
56
56
  "spec/roles_mongoid/strategy/api_examples.rb",
57
57
  "spec/roles_mongoid/strategy/multi/embed_many_roles_spec.rb",
58
+ "spec/roles_mongoid/strategy/multi/many_roles_old_spec.rb",
58
59
  "spec/roles_mongoid/strategy/multi/many_roles_spec.rb",
59
60
  "spec/roles_mongoid/strategy/multi/role_strings_spec.rb",
60
61
  "spec/roles_mongoid/strategy/multi/roles_mask_spec.rb",
@@ -76,6 +77,7 @@ Gem::Specification.new do |s|
76
77
  "spec/roles_mongoid/generators/roles_generator_spec.rb",
77
78
  "spec/roles_mongoid/strategy/api_examples.rb",
78
79
  "spec/roles_mongoid/strategy/multi/embed_many_roles_spec.rb",
80
+ "spec/roles_mongoid/strategy/multi/many_roles_old_spec.rb",
79
81
  "spec/roles_mongoid/strategy/multi/many_roles_spec.rb",
80
82
  "spec/roles_mongoid/strategy/multi/role_strings_spec.rb",
81
83
  "spec/roles_mongoid/strategy/multi/roles_mask_spec.rb",
@@ -92,57 +94,57 @@ Gem::Specification.new do |s|
92
94
  s.specification_version = 3
93
95
 
94
96
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
95
- s.add_runtime_dependency(%q<mongoid>, [">= 2.0.0.rc.1"])
96
- s.add_runtime_dependency(%q<bson>, [">= 1.1.1"])
97
- s.add_runtime_dependency(%q<activesupport>, ["~> 3.0.1"])
97
+ s.add_runtime_dependency(%q<mongoid>, ["~> 2.0.0.rc.5"])
98
+ s.add_runtime_dependency(%q<bson>, [">= 1.1.5"])
99
+ s.add_runtime_dependency(%q<activesupport>, ["~> 3.0.3"])
98
100
  s.add_runtime_dependency(%q<require_all>, ["~> 1.2.0"])
99
- s.add_runtime_dependency(%q<sugar-high>, [">= 0.3.0"])
100
- s.add_runtime_dependency(%q<roles_generic>, [">= 0.3.2"])
101
- s.add_runtime_dependency(%q<logging_assist>, [">= 0.2.0"])
102
- s.add_development_dependency(%q<rspec>, [">= 2.0.1"])
101
+ s.add_runtime_dependency(%q<sugar-high>, [">= 0.3.5"])
102
+ s.add_runtime_dependency(%q<roles_generic>, [">= 0.3.6"])
103
+ s.add_runtime_dependency(%q<logging_assist>, [">= 0.2.1"])
104
+ s.add_development_dependency(%q<rspec>, [">= 2.4.0"])
103
105
  s.add_development_dependency(%q<generator-spec>, [">= 0.7.0"])
104
- s.add_runtime_dependency(%q<mongoid>, [">= 2.0.0.rc.1"])
105
- s.add_runtime_dependency(%q<bson>, [">= 1.1.4"])
106
- s.add_runtime_dependency(%q<sugar-high>, ["~> 0.3.1"])
106
+ s.add_runtime_dependency(%q<mongoid>, ["~> 2.0.0.rc.5"])
107
+ s.add_runtime_dependency(%q<bson>, [">= 1.1.5"])
108
+ s.add_runtime_dependency(%q<sugar-high>, ["~> 0.3.5"])
107
109
  s.add_runtime_dependency(%q<require_all>, ["~> 1.2.0"])
108
- s.add_runtime_dependency(%q<roles_generic>, [">= 0.3.3"])
110
+ s.add_runtime_dependency(%q<roles_generic>, [">= 0.3.6"])
109
111
  s.add_runtime_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
110
- s.add_runtime_dependency(%q<logging_assist>, [">= 0.2.0"])
112
+ s.add_runtime_dependency(%q<logging_assist>, [">= 0.2.1"])
111
113
  else
112
- s.add_dependency(%q<mongoid>, [">= 2.0.0.rc.1"])
113
- s.add_dependency(%q<bson>, [">= 1.1.1"])
114
- s.add_dependency(%q<activesupport>, ["~> 3.0.1"])
114
+ s.add_dependency(%q<mongoid>, ["~> 2.0.0.rc.5"])
115
+ s.add_dependency(%q<bson>, [">= 1.1.5"])
116
+ s.add_dependency(%q<activesupport>, ["~> 3.0.3"])
115
117
  s.add_dependency(%q<require_all>, ["~> 1.2.0"])
116
- s.add_dependency(%q<sugar-high>, [">= 0.3.0"])
117
- s.add_dependency(%q<roles_generic>, [">= 0.3.2"])
118
- s.add_dependency(%q<logging_assist>, [">= 0.2.0"])
119
- s.add_dependency(%q<rspec>, [">= 2.0.1"])
118
+ s.add_dependency(%q<sugar-high>, [">= 0.3.5"])
119
+ s.add_dependency(%q<roles_generic>, [">= 0.3.6"])
120
+ s.add_dependency(%q<logging_assist>, [">= 0.2.1"])
121
+ s.add_dependency(%q<rspec>, [">= 2.4.0"])
120
122
  s.add_dependency(%q<generator-spec>, [">= 0.7.0"])
121
- s.add_dependency(%q<mongoid>, [">= 2.0.0.rc.1"])
122
- s.add_dependency(%q<bson>, [">= 1.1.4"])
123
- s.add_dependency(%q<sugar-high>, ["~> 0.3.1"])
123
+ s.add_dependency(%q<mongoid>, ["~> 2.0.0.rc.5"])
124
+ s.add_dependency(%q<bson>, [">= 1.1.5"])
125
+ s.add_dependency(%q<sugar-high>, ["~> 0.3.5"])
124
126
  s.add_dependency(%q<require_all>, ["~> 1.2.0"])
125
- s.add_dependency(%q<roles_generic>, [">= 0.3.3"])
127
+ s.add_dependency(%q<roles_generic>, [">= 0.3.6"])
126
128
  s.add_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
127
- s.add_dependency(%q<logging_assist>, [">= 0.2.0"])
129
+ s.add_dependency(%q<logging_assist>, [">= 0.2.1"])
128
130
  end
129
131
  else
130
- s.add_dependency(%q<mongoid>, [">= 2.0.0.rc.1"])
131
- s.add_dependency(%q<bson>, [">= 1.1.1"])
132
- s.add_dependency(%q<activesupport>, ["~> 3.0.1"])
132
+ s.add_dependency(%q<mongoid>, ["~> 2.0.0.rc.5"])
133
+ s.add_dependency(%q<bson>, [">= 1.1.5"])
134
+ s.add_dependency(%q<activesupport>, ["~> 3.0.3"])
133
135
  s.add_dependency(%q<require_all>, ["~> 1.2.0"])
134
- s.add_dependency(%q<sugar-high>, [">= 0.3.0"])
135
- s.add_dependency(%q<roles_generic>, [">= 0.3.2"])
136
- s.add_dependency(%q<logging_assist>, [">= 0.2.0"])
137
- s.add_dependency(%q<rspec>, [">= 2.0.1"])
136
+ s.add_dependency(%q<sugar-high>, [">= 0.3.5"])
137
+ s.add_dependency(%q<roles_generic>, [">= 0.3.6"])
138
+ s.add_dependency(%q<logging_assist>, [">= 0.2.1"])
139
+ s.add_dependency(%q<rspec>, [">= 2.4.0"])
138
140
  s.add_dependency(%q<generator-spec>, [">= 0.7.0"])
139
- s.add_dependency(%q<mongoid>, [">= 2.0.0.rc.1"])
140
- s.add_dependency(%q<bson>, [">= 1.1.4"])
141
- s.add_dependency(%q<sugar-high>, ["~> 0.3.1"])
141
+ s.add_dependency(%q<mongoid>, ["~> 2.0.0.rc.5"])
142
+ s.add_dependency(%q<bson>, [">= 1.1.5"])
143
+ s.add_dependency(%q<sugar-high>, ["~> 0.3.5"])
142
144
  s.add_dependency(%q<require_all>, ["~> 1.2.0"])
143
- s.add_dependency(%q<roles_generic>, [">= 0.3.3"])
145
+ s.add_dependency(%q<roles_generic>, [">= 0.3.6"])
144
146
  s.add_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
145
- s.add_dependency(%q<logging_assist>, [">= 0.2.0"])
147
+ s.add_dependency(%q<logging_assist>, [">= 0.2.1"])
146
148
  end
147
149
  end
148
150
 
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ # IMPORTANT
4
+ # This is only to support Mongoid 2 before rc.5
5
+
6
+ class Role
7
+ end
8
+
9
+ class User
10
+ include Mongoid::Document
11
+ include Roles::Mongoid
12
+
13
+ strategy :many_roles_old
14
+ valid_roles_are :admin, :guest, :user
15
+ end
16
+
17
+ def api_name
18
+ :many_roles_old
19
+ end
20
+
21
+ load 'roles_mongoid/strategy/api_examples.rb'
22
+
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 4
9
- version: 0.4.4
8
+ - 5
9
+ version: 0.4.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-10 00:00:00 +01:00
17
+ date: 2011-01-19 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -22,15 +22,15 @@ dependencies:
22
22
  requirement: &id001 !ruby/object:Gem::Requirement
23
23
  none: false
24
24
  requirements:
25
- - - ">="
25
+ - - ~>
26
26
  - !ruby/object:Gem::Version
27
27
  segments:
28
28
  - 2
29
29
  - 0
30
30
  - 0
31
31
  - rc
32
- - 1
33
- version: 2.0.0.rc.1
32
+ - 5
33
+ version: 2.0.0.rc.5
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: *id001
@@ -44,8 +44,8 @@ dependencies:
44
44
  segments:
45
45
  - 1
46
46
  - 1
47
- - 1
48
- version: 1.1.1
47
+ - 5
48
+ version: 1.1.5
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: *id002
@@ -59,8 +59,8 @@ dependencies:
59
59
  segments:
60
60
  - 3
61
61
  - 0
62
- - 1
63
- version: 3.0.1
62
+ - 3
63
+ version: 3.0.3
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: *id003
@@ -89,8 +89,8 @@ dependencies:
89
89
  segments:
90
90
  - 0
91
91
  - 3
92
- - 0
93
- version: 0.3.0
92
+ - 5
93
+ version: 0.3.5
94
94
  type: :runtime
95
95
  prerelease: false
96
96
  version_requirements: *id005
@@ -104,8 +104,8 @@ dependencies:
104
104
  segments:
105
105
  - 0
106
106
  - 3
107
- - 2
108
- version: 0.3.2
107
+ - 6
108
+ version: 0.3.6
109
109
  type: :runtime
110
110
  prerelease: false
111
111
  version_requirements: *id006
@@ -119,8 +119,8 @@ dependencies:
119
119
  segments:
120
120
  - 0
121
121
  - 2
122
- - 0
123
- version: 0.2.0
122
+ - 1
123
+ version: 0.2.1
124
124
  type: :runtime
125
125
  prerelease: false
126
126
  version_requirements: *id007
@@ -133,9 +133,9 @@ dependencies:
133
133
  - !ruby/object:Gem::Version
134
134
  segments:
135
135
  - 2
136
+ - 4
136
137
  - 0
137
- - 1
138
- version: 2.0.1
138
+ version: 2.4.0
139
139
  type: :development
140
140
  prerelease: false
141
141
  version_requirements: *id008
@@ -159,15 +159,15 @@ dependencies:
159
159
  requirement: &id010 !ruby/object:Gem::Requirement
160
160
  none: false
161
161
  requirements:
162
- - - ">="
162
+ - - ~>
163
163
  - !ruby/object:Gem::Version
164
164
  segments:
165
165
  - 2
166
166
  - 0
167
167
  - 0
168
168
  - rc
169
- - 1
170
- version: 2.0.0.rc.1
169
+ - 5
170
+ version: 2.0.0.rc.5
171
171
  type: :runtime
172
172
  prerelease: false
173
173
  version_requirements: *id010
@@ -181,8 +181,8 @@ dependencies:
181
181
  segments:
182
182
  - 1
183
183
  - 1
184
- - 4
185
- version: 1.1.4
184
+ - 5
185
+ version: 1.1.5
186
186
  type: :runtime
187
187
  prerelease: false
188
188
  version_requirements: *id011
@@ -196,8 +196,8 @@ dependencies:
196
196
  segments:
197
197
  - 0
198
198
  - 3
199
- - 1
200
- version: 0.3.1
199
+ - 5
200
+ version: 0.3.5
201
201
  type: :runtime
202
202
  prerelease: false
203
203
  version_requirements: *id012
@@ -226,8 +226,8 @@ dependencies:
226
226
  segments:
227
227
  - 0
228
228
  - 3
229
- - 3
230
- version: 0.3.3
229
+ - 6
230
+ version: 0.3.6
231
231
  type: :runtime
232
232
  prerelease: false
233
233
  version_requirements: *id014
@@ -256,8 +256,8 @@ dependencies:
256
256
  segments:
257
257
  - 0
258
258
  - 2
259
- - 0
260
- version: 0.2.0
259
+ - 1
260
+ version: 0.2.1
261
261
  type: :runtime
262
262
  prerelease: false
263
263
  version_requirements: *id016
@@ -309,6 +309,7 @@ files:
309
309
  - spec/roles_mongoid/generators/roles_generator_spec.rb
310
310
  - spec/roles_mongoid/strategy/api_examples.rb
311
311
  - spec/roles_mongoid/strategy/multi/embed_many_roles_spec.rb
312
+ - spec/roles_mongoid/strategy/multi/many_roles_old_spec.rb
312
313
  - spec/roles_mongoid/strategy/multi/many_roles_spec.rb
313
314
  - spec/roles_mongoid/strategy/multi/role_strings_spec.rb
314
315
  - spec/roles_mongoid/strategy/multi/roles_mask_spec.rb
@@ -357,6 +358,7 @@ test_files:
357
358
  - spec/roles_mongoid/generators/roles_generator_spec.rb
358
359
  - spec/roles_mongoid/strategy/api_examples.rb
359
360
  - spec/roles_mongoid/strategy/multi/embed_many_roles_spec.rb
361
+ - spec/roles_mongoid/strategy/multi/many_roles_old_spec.rb
360
362
  - spec/roles_mongoid/strategy/multi/many_roles_spec.rb
361
363
  - spec/roles_mongoid/strategy/multi/role_strings_spec.rb
362
364
  - spec/roles_mongoid/strategy/multi/roles_mask_spec.rb