aegis 2.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -29,6 +29,7 @@ begin
29
29
  gemspec.homepage = "http://github.com/makandra/aegis"
30
30
  gemspec.description = "Aegis is an authorization solution for Ruby on Rails that supports roles and a RESTish, resource-style declaration of permission rules."
31
31
  gemspec.authors = ["Henning Koch", "Tobias Kraze"]
32
+ gemspec.post_install_message = "Upgrade notice:\nIf you are using Aegis' automatic controller integration, include Aegis::Controller in your ApplicationController\nAlso see http://wiki.github.com/makandra/aegis/controller-integration\n"
32
33
  end
33
34
  rescue LoadError
34
35
  puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.0
1
+ 2.4.0
data/aegis.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{aegis}
8
- s.version = "2.3.0"
8
+ s.version = "2.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Henning Koch", "Tobias Kraze"]
12
- s.date = %q{2010-09-01}
12
+ s.date = %q{2010-09-03}
13
13
  s.description = %q{Aegis is an authorization solution for Ruby on Rails that supports roles and a RESTish, resource-style declaration of permission rules.}
14
14
  s.email = %q{henning.koch@makandra.de}
15
15
  s.extra_rdoc_files = [
@@ -24,7 +24,9 @@ Gem::Specification.new do |s|
24
24
  "aegis.gemspec",
25
25
  "lib/aegis.rb",
26
26
  "lib/aegis/action.rb",
27
+ "lib/aegis/active_record_ext.rb",
27
28
  "lib/aegis/compiler.rb",
29
+ "lib/aegis/controller.rb",
28
30
  "lib/aegis/errors.rb",
29
31
  "lib/aegis/has_role.rb",
30
32
  "lib/aegis/loader.rb",
@@ -35,9 +37,7 @@ Gem::Specification.new do |s|
35
37
  "lib/aegis/sieve.rb",
36
38
  "lib/aegis/spec.rb",
37
39
  "lib/aegis/spec/matchers.rb",
38
- "lib/rails/action_controller.rb",
39
- "lib/rails/active_record.rb",
40
- "spec/aegis/action_controller_spec.rb",
40
+ "spec/aegis/controller_spec.rb",
41
41
  "spec/aegis/has_role_spec.rb",
42
42
  "spec/aegis/loader_spec.rb",
43
43
  "spec/aegis/permissions_spec.rb",
@@ -71,6 +71,10 @@ Gem::Specification.new do |s|
71
71
  "spec/spec_helper.rb"
72
72
  ]
73
73
  s.homepage = %q{http://github.com/makandra/aegis}
74
+ s.post_install_message = %q{Upgrade notice:
75
+ If you are using Aegis' automatic controller integration, include Aegis::Controller in your ApplicationController
76
+ Also see http://wiki.github.com/makandra/aegis/controller-integration
77
+ }
74
78
  s.rdoc_options = ["--charset=UTF-8"]
75
79
  s.require_paths = ["lib"]
76
80
  s.rubygems_version = %q{1.3.6}
@@ -97,12 +101,12 @@ Gem::Specification.new do |s|
97
101
  "spec/app_root/lib/console_with_fixtures.rb",
98
102
  "spec/controllers/reviews_controller_spec.rb",
99
103
  "spec/spec_helper.rb",
100
- "spec/aegis/action_controller_spec.rb",
101
104
  "spec/aegis/has_role_spec.rb",
102
105
  "spec/aegis/loader_spec.rb",
103
106
  "spec/aegis/permissions_spec.rb",
104
107
  "spec/aegis/sieve_spec.rb",
105
- "spec/aegis/spec/matchers_spec.rb"
108
+ "spec/aegis/spec/matchers_spec.rb",
109
+ "spec/aegis/controller_spec.rb"
106
110
  ]
107
111
 
108
112
  if s.respond_to? :specification_version then
@@ -1,5 +1,10 @@
1
1
  module Aegis
2
- module ActionController
2
+ module Controller
3
+
4
+ def self.included(base)
5
+ base.send :include, InstanceMethods
6
+ base.send :extend, ClassMethods
7
+ end
3
8
 
4
9
  module ClassMethods
5
10
 
@@ -67,7 +72,3 @@ module Aegis
67
72
  end
68
73
  end
69
74
 
70
- ActionController::Base.extend Aegis::ActionController::ClassMethods
71
- ActionController::Base.send :include, Aegis::ActionController::InstanceMethods
72
-
73
-
data/lib/aegis/loader.rb CHANGED
@@ -14,9 +14,8 @@ module Aegis
14
14
  'aegis/resource',
15
15
  'aegis/role',
16
16
  'aegis/sieve',
17
-
18
- 'rails/action_controller',
19
- 'rails/active_record' ]
17
+ 'aegis/controller',
18
+ 'aegis/active_record_ext' ]
20
19
  end
21
20
 
22
21
  def load_paths
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- describe Aegis::ActionController do
3
+ describe Aegis::Controller do
4
4
 
5
5
  before(:each) do
6
6
 
@@ -21,6 +21,7 @@ describe Aegis::ActionController do
21
21
  user = @user = @user_class.new(:role_name => 'user')
22
22
 
23
23
  @controller_class = Class.new(ActionController::Base) do
24
+ include Aegis::Controller
24
25
  define_method :current_user do
25
26
  user
26
27
  end
@@ -38,6 +38,7 @@ describe Aegis::Spec::Matchers do
38
38
 
39
39
  before(:each) do
40
40
  @controller = Class.new(ActionController::Base) do
41
+ include Aegis::Controller
41
42
  permissions :post
42
43
  end.new
43
44
  end
@@ -1,4 +1,5 @@
1
1
  class ApplicationController < ActionController::Base
2
+ include Aegis::Controller
2
3
 
3
4
  require_permissions
4
5
 
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 2
7
- - 3
7
+ - 4
8
8
  - 0
9
- version: 2.3.0
9
+ version: 2.4.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Henning Koch
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-01 00:00:00 +02:00
18
+ date: 2010-09-03 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -36,7 +36,9 @@ files:
36
36
  - aegis.gemspec
37
37
  - lib/aegis.rb
38
38
  - lib/aegis/action.rb
39
+ - lib/aegis/active_record_ext.rb
39
40
  - lib/aegis/compiler.rb
41
+ - lib/aegis/controller.rb
40
42
  - lib/aegis/errors.rb
41
43
  - lib/aegis/has_role.rb
42
44
  - lib/aegis/loader.rb
@@ -47,9 +49,7 @@ files:
47
49
  - lib/aegis/sieve.rb
48
50
  - lib/aegis/spec.rb
49
51
  - lib/aegis/spec/matchers.rb
50
- - lib/rails/action_controller.rb
51
- - lib/rails/active_record.rb
52
- - spec/aegis/action_controller_spec.rb
52
+ - spec/aegis/controller_spec.rb
53
53
  - spec/aegis/has_role_spec.rb
54
54
  - spec/aegis/loader_spec.rb
55
55
  - spec/aegis/permissions_spec.rb
@@ -85,7 +85,11 @@ has_rdoc: true
85
85
  homepage: http://github.com/makandra/aegis
86
86
  licenses: []
87
87
 
88
- post_install_message:
88
+ post_install_message: |
89
+ Upgrade notice:
90
+ If you are using Aegis' automatic controller integration, include Aegis::Controller in your ApplicationController
91
+ Also see http://wiki.github.com/makandra/aegis/controller-integration
92
+
89
93
  rdoc_options:
90
94
  - --charset=UTF-8
91
95
  require_paths:
@@ -133,9 +137,9 @@ test_files:
133
137
  - spec/app_root/lib/console_with_fixtures.rb
134
138
  - spec/controllers/reviews_controller_spec.rb
135
139
  - spec/spec_helper.rb
136
- - spec/aegis/action_controller_spec.rb
137
140
  - spec/aegis/has_role_spec.rb
138
141
  - spec/aegis/loader_spec.rb
139
142
  - spec/aegis/permissions_spec.rb
140
143
  - spec/aegis/sieve_spec.rb
141
144
  - spec/aegis/spec/matchers_spec.rb
145
+ - spec/aegis/controller_spec.rb