cream 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/cream.gemspec +2 -2
- data/lib/generators/roles/config/config_generator.rb +9 -5
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.5
|
data/cream.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cream}
|
8
|
-
s.version = "0.8.
|
8
|
+
s.version = "0.8.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-
|
12
|
+
s.date = %q{2011-01-03}
|
13
13
|
s.description = %q{Provides assistance for setting up Session, Role and Permission systems for a Rails 3 app. Support for multiple ORMs}
|
14
14
|
s.email = %q{kmandrup@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -19,6 +19,10 @@ module Roles
|
|
19
19
|
|
20
20
|
def configure_roles
|
21
21
|
logger.add_logfile :logfile => logfile if logfile
|
22
|
+
|
23
|
+
# make the artifactor model methods behave according to selected orm! - this is a macro
|
24
|
+
self.class.use_orm :"#{orm}"
|
25
|
+
|
22
26
|
roles_gems if gems?
|
23
27
|
create_roles
|
24
28
|
use_roles_strategy
|
@@ -93,7 +97,7 @@ module Roles
|
|
93
97
|
if initializer_file? :cream
|
94
98
|
if read_model(:user) =~ /valid_roles_are/
|
95
99
|
replace_in_model :user, :where => /valid_roles_are\s+[(.*)]/, :with => 'valid_roles_are Cream.roles'
|
96
|
-
else
|
100
|
+
else
|
97
101
|
insert_into_model :user do
|
98
102
|
"valid_roles_are Cream::Role.available"
|
99
103
|
end
|
@@ -108,11 +112,11 @@ module Roles
|
|
108
112
|
end
|
109
113
|
|
110
114
|
def use_roles_strategy
|
111
|
-
user_exist?
|
115
|
+
# user_exist?
|
112
116
|
|
113
|
-
unless read_model(:user) =~ /use_roles_strategy/
|
114
|
-
|
115
|
-
end
|
117
|
+
# unless read_model(:user) =~ /use_roles_strategy/
|
118
|
+
# inject_into_file model_file(:user), "use_roles_strategy :#{strategy}\n\n", :before => "class"
|
119
|
+
# end
|
116
120
|
end
|
117
121
|
|
118
122
|
def default_roles
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 8
|
8
|
-
-
|
9
|
-
version: 0.8.
|
8
|
+
- 5
|
9
|
+
version: 0.8.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-
|
17
|
+
date: 2011-01-03 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|