cream 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/cream.gemspec +1 -1
- data/lib/cream.rb +3 -1
- data/lib/cream/configure.rb +1 -1
- data/lib/cream/configure/rails.rb +1 -3
- data/spec/cream/configure/rails_spec.rb +3 -5
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.1
|
data/cream.gemspec
CHANGED
data/lib/cream.rb
CHANGED
@@ -7,7 +7,7 @@ require 'cancan'
|
|
7
7
|
require 'cancan-rest-links'
|
8
8
|
require 'cancan-permits'
|
9
9
|
|
10
|
-
require 'cream/namespaces'
|
10
|
+
require 'cream/namespaces'
|
11
11
|
|
12
12
|
require 'sugar-high/alias'
|
13
13
|
require 'sugar-high/kind_of'
|
@@ -18,3 +18,5 @@ require_all File.dirname(__FILE__) + '/cream/controller'
|
|
18
18
|
require_all File.dirname(__FILE__) + '/cream/helper'
|
19
19
|
require_all File.dirname(__FILE__) + '/cream/view'
|
20
20
|
|
21
|
+
require 'cream/configure'
|
22
|
+
|
data/lib/cream/configure.rb
CHANGED
@@ -7,8 +7,7 @@ Rails3::Plugin::Extender.new do
|
|
7
7
|
extend_rails :controller do
|
8
8
|
extend_from_module Cream, :role
|
9
9
|
extend_from_module Cream::Controller, :ability
|
10
|
-
extend_from_module Cream::Helper, :role, :
|
11
|
-
extend_from_module Cream::Link, :session, :registration, :rest, :session
|
10
|
+
extend_from_module Cream::Helper, :role, :host, :auth_label
|
12
11
|
end
|
13
12
|
|
14
13
|
# extend action_view with methods from some modules
|
@@ -18,7 +17,6 @@ Rails3::Plugin::Extender.new do
|
|
18
17
|
end
|
19
18
|
|
20
19
|
after :initialize do
|
21
|
-
puts "Rails app initialized"
|
22
20
|
require_all File.dirname(__FILE__) + '/after_init'
|
23
21
|
end
|
24
22
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'configure_helper'
|
2
2
|
|
3
|
+
require 'cream/configure'
|
4
|
+
|
3
5
|
class Role
|
4
6
|
attr_accessor :name
|
5
7
|
|
@@ -12,9 +14,6 @@ class Role
|
|
12
14
|
end
|
13
15
|
end
|
14
16
|
|
15
|
-
require 'cream/role'
|
16
|
-
require 'cream/configure'
|
17
|
-
|
18
17
|
describe "Rails extension" do
|
19
18
|
describe 'Extensions' do
|
20
19
|
it "should extend Action View with Roles helper instance_methods and specific role methods" do
|
@@ -30,8 +29,7 @@ describe "Rails extension" do
|
|
30
29
|
after_init :controller do
|
31
30
|
:controller.should be_extended_with Cream, :role
|
32
31
|
:controller.should be_extended_with Cream::Controller, :ability
|
33
|
-
:controller.should be_extended_with Cream::Helper, :role, :
|
34
|
-
:controller.should be_extended_with Cream::Link, :session, :registration, :rest, :session
|
32
|
+
:controller.should be_extended_with Cream::Helper, :role, :host, :auth_label
|
35
33
|
end
|
36
34
|
|
37
35
|
init_app_railties :minimal, :view
|