cream 0.5.8 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.8
1
+ 0.5.9
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cream}
8
- s.version = "0.5.8"
8
+ s.version = "0.5.9"
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"]
@@ -1,6 +1,4 @@
1
- require 'active_support/inflector'
2
1
  require 'require_all'
3
-
4
2
  require 'rails'
5
3
  # require 'devise'
6
4
  require 'devise-links'
@@ -15,6 +13,7 @@ require 'sugar-high/alias'
15
13
  require 'sugar-high/kind_of'
16
14
  require 'sugar-high/array'
17
15
 
16
+ require 'cream/role'
18
17
  require_all File.dirname(__FILE__) + '/cream/controller'
19
18
  require_all File.dirname(__FILE__) + '/cream/helper'
20
19
  require_all File.dirname(__FILE__) + '/cream/view'
@@ -3,12 +3,13 @@ require 'r3_plugin_toolbox'
3
3
 
4
4
  Rails3::Plugin::Extender.new do
5
5
  # extend action_controller with methods from some modules
6
- # extend_rails(:controller) do
7
- # extend_from_module Cream, :role
8
- # extend_from_module Cream::Controller, :ability
9
- # extend_from_module Cream::Helper, :role, :local_host, :auth_label
10
- # extend_from_module Cream::Link, :session, :registration, :rest, :session
11
- # end
6
+
7
+ extend_rails :controller do
8
+ extend_from_module Cream, :role
9
+ extend_from_module Cream::Controller, :ability
10
+ extend_from_module Cream::Helper, :role, :local_host, :auth_label
11
+ extend_from_module Cream::Link, :session, :registration, :rest, :session
12
+ end
12
13
 
13
14
  # extend action_view with methods from some modules
14
15
  extend_rails :view do
@@ -16,18 +16,24 @@ require 'cream/role'
16
16
  require 'cream/configure'
17
17
 
18
18
  describe "Rails extension" do
19
- describe 'View extension' do
19
+ describe 'Extensions' do
20
20
  it "should extend Action View with Roles helper instance_methods and specific role methods" do
21
21
  after_init :view do
22
22
  :view.should be_extended_with Cream::View, :role, :host, :user_action_menu
23
23
  :view.should be_extended_with Cream::Helper, :role
24
- # [:admin, :guest].each do |role|
25
- # view.should respond_to? :"for_#{role}"
26
- # view.should respond_to? :"#{role}_area"
27
- # view.should respond_to? :"#{role}?"
28
- # end
29
24
  end
25
+
26
+ init_app_railties :minimal, :view
27
+ end
30
28
 
29
+ it "should extend Action Controller" do
30
+ after_init :controller do
31
+ :controller.should be_extended_with Cream, :role
32
+ :controller.should be_extended_with Cream::Controller, :ability
33
+ :controller.should be_extended_with Cream::Helper, :role, :local_host, :auth_label
34
+ :controller.should be_extended_with Cream::Link, :session, :registration, :rest, :session
35
+ end
36
+
31
37
  init_app_railties :minimal, :view
32
38
  end
33
39
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 8
9
- version: 0.5.8
8
+ - 9
9
+ version: 0.5.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup