aegis 1.1.8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. data/.gitignore +4 -0
  2. data/README.rdoc +58 -165
  3. data/Rakefile +20 -12
  4. data/VERSION +1 -1
  5. data/aegis.gemspec +85 -56
  6. data/lib/aegis.rb +9 -6
  7. data/lib/aegis/access_denied.rb +4 -0
  8. data/lib/aegis/action.rb +99 -0
  9. data/lib/aegis/compiler.rb +113 -0
  10. data/lib/aegis/has_role.rb +89 -110
  11. data/lib/aegis/parser.rb +110 -0
  12. data/lib/aegis/permissions.rb +164 -107
  13. data/lib/aegis/resource.rb +158 -0
  14. data/lib/aegis/role.rb +25 -55
  15. data/lib/aegis/sieve.rb +39 -0
  16. data/lib/rails/action_controller.rb +38 -0
  17. data/lib/rails/active_record.rb +1 -5
  18. data/spec/action_controller_spec.rb +100 -0
  19. data/spec/app_root/app/controllers/application_controller.rb +7 -0
  20. data/spec/app_root/app/controllers/reviews_controller.rb +36 -0
  21. data/spec/app_root/app/models/permissions.rb +14 -0
  22. data/spec/app_root/app/models/property.rb +5 -0
  23. data/spec/app_root/app/models/review.rb +5 -0
  24. data/{test → spec}/app_root/app/models/user.rb +1 -2
  25. data/{test → spec}/app_root/config/boot.rb +0 -0
  26. data/{test → spec}/app_root/config/database.yml +0 -0
  27. data/{test → spec}/app_root/config/environment.rb +0 -0
  28. data/{test → spec}/app_root/config/environments/in_memory.rb +0 -0
  29. data/{test → spec}/app_root/config/environments/mysql.rb +0 -0
  30. data/{test → spec}/app_root/config/environments/postgresql.rb +0 -0
  31. data/{test → spec}/app_root/config/environments/sqlite.rb +0 -0
  32. data/{test → spec}/app_root/config/environments/sqlite3.rb +0 -0
  33. data/spec/app_root/config/routes.rb +7 -0
  34. data/{test/app_root/db/migrate/20090408115228_create_users.rb → spec/app_root/db/migrate/001_create_users.rb} +2 -1
  35. data/spec/app_root/db/migrate/002_create_properties.rb +13 -0
  36. data/spec/app_root/db/migrate/003_create_reviews.rb +14 -0
  37. data/{test → spec}/app_root/lib/console_with_fixtures.rb +0 -0
  38. data/{test → spec}/app_root/log/.gitignore +0 -0
  39. data/{test → spec}/app_root/script/console +0 -0
  40. data/spec/controllers/reviews_controller_spec.rb +19 -0
  41. data/spec/has_role_spec.rb +177 -0
  42. data/spec/permissions_spec.rb +550 -0
  43. data/spec/rcov.opts +2 -0
  44. data/spec/spec.opts +4 -0
  45. data/{test/test_helper.rb → spec/spec_helper.rb} +6 -9
  46. metadata +73 -57
  47. data/lib/aegis/constants.rb +0 -6
  48. data/lib/aegis/normalization.rb +0 -26
  49. data/lib/aegis/permission_error.rb +0 -5
  50. data/lib/aegis/permission_evaluator.rb +0 -34
  51. data/test/app_root/app/controllers/application_controller.rb +0 -2
  52. data/test/app_root/app/models/old_soldier.rb +0 -6
  53. data/test/app_root/app/models/permissions.rb +0 -49
  54. data/test/app_root/app/models/soldier.rb +0 -5
  55. data/test/app_root/app/models/trust_fund_kid.rb +0 -5
  56. data/test/app_root/app/models/user_subclass.rb +0 -2
  57. data/test/app_root/app/models/veteran_soldier.rb +0 -6
  58. data/test/app_root/config/routes.rb +0 -4
  59. data/test/app_root/db/migrate/20090429075648_create_soldiers.rb +0 -14
  60. data/test/app_root/db/migrate/20091110075648_create_veteran_soldiers.rb +0 -14
  61. data/test/app_root/db/migrate/20091110075649_create_trust_fund_kids.rb +0 -15
  62. data/test/has_role_options_test.rb +0 -64
  63. data/test/has_role_test.rb +0 -54
  64. data/test/permissions_test.rb +0 -109
  65. data/test/validation_test.rb +0 -55
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ doc
2
+ pkg
3
+ *.gem
4
+ .idea
data/README.rdoc CHANGED
@@ -1,195 +1,88 @@
1
- = Aegis - role-based permissions for your user models
1
+ = Aegis - A complete authorization solution for Rails
2
2
 
3
- Aegis allows you to manage fine-grained, complex permission for user accounts in a central place.
3
+ Aegis is an authorization solution for Ruby on Rails that supports roles and a RESTish, resource-style declaration of
4
+ permission rules. Getting started with Aegis is easy and requires very little integration. As your authorization
5
+ requirements become more complex, Aegis will grow with you.
4
6
 
5
- == Installation
6
-
7
- Add the following to your <tt>Initializer.run</tt> block in your <tt>environment.rb</tt>:
8
- config.gem 'aegis', :source => 'http://gemcutter.org'
9
- Then do a
10
- sudo rake gems:install
11
7
 
12
- Alternatively, use
13
- sudo gem sources -a http://gemcutter.org
14
- sudo gem install aegis
8
+ == Getting started
15
9
 
16
- == Example
17
-
18
- First, let's define some roles:
19
-
20
- # app/models/permissions.rb
21
- class Permissions < Aegis::Permissions
22
-
23
- role :guest
24
- role :registered_user
25
- role :moderator
26
- role :administrator, :default_permission => :allow
27
-
28
- permission :edit_post do |user, post|
29
- allow :registered_user do
30
- post.creator == user # a registered_user can only edit his own posts
31
- end
32
- allow :moderator
33
- end
34
-
35
- permission :read_post do |post|
36
- allow :everyone
37
- deny :guest do
38
- post.private? # guests may not read private posts
39
- end
40
- end
10
+ All your permissions live in a single class <tt>Permissions</tt>.
11
+ Permissions are described using <tt>resources</tt>, similiar to your routes.
12
+ Your permission resources can match those in your routes, but don't have to.
41
13
 
42
- end
14
+ Access to resources or individual actions can be granted or denied to specific roles.
43
15
 
16
+ class Permissions < Aegis::Permissions
44
17
 
45
- Now we assign roles to users. For this, the users table needs to have a string
46
- column +role_name+.
18
+ role :user
19
+ role :admin
47
20
 
48
- # app/models/user.rb
49
- class User
50
- has_role
21
+ resources :projects do
22
+ allow :everyone
51
23
  end
52
24
 
53
-
54
- These permissions may be used in views and controllers:
55
-
56
- # app/views/posts/index.html.erb
57
- @posts.each do |post|
58
- <% if current_user.may_read_post? post %>
59
- <%= render post %>
60
- <% if current_user.may_edit_post? post %>
61
- <%= link_to 'Edit', edit_post_path(post) %>
62
- <% end %>
63
- <% end %>
64
- <% end %>
65
-
66
-
67
- # app/controllers/posts_controller.rb
68
- class PostsController
69
- # ...
70
-
71
- def update
72
- @post = Post.find(params[:id])
73
- current_user.may_edit_post! @post # raises an Aegis::PermissionError for unauthorized access
74
- # ...
75
- end
76
-
25
+ resources :users do
26
+ allow :admin
77
27
  end
78
28
 
79
- == Details
29
+ end
80
30
 
81
- === Roles
31
+ To give your user model a role, it needs to have an attribute +role_name+. The <tt>has_role</tt> macro wires everything together:
82
32
 
83
- To equip a (user) model with any permissions, you simply call *has_role* within
84
- the model:
85
- class User < ActiveRecord::Base
86
- has_role
87
- end
88
- Aegis assumes that the corresponding database table has a string-valued column
89
- called +role_name+. You may override the name with the <tt>:name_accessor =>
90
- :my_role_column</tt> option.
33
+ class User < ActiveRecord::Base
34
+ has_role
35
+ end
91
36
 
92
- You can define a default role for a model by saying
93
- class User < ActiveRecord::Base
94
- has_role :default => :admin
95
- end
96
- All this will do, is initialize the +role_name+ with the given default when
97
- <tt>User.new</tt> is called.
98
-
99
- The roles and permissions themselves are defined in a class inheriting from
100
- <b>Aegis::Permissions</b>. To define roles you create a model <tt>permissions.rb</tt>
101
- and use the *role* method:
102
- class Permissions < Aegis::Permissions
103
- role 'role_name'
104
- end
37
+ You can now check if a user has permission to access a given action in your controllers and views:
38
+
39
+ <% if current_user.may_update_project? @project %>
40
+ <%= link_to 'Edit', edit_project_path(@project) %>
41
+ <% end %>
105
42
 
106
- By default, users belonging to this role are not permitted anything. You may
107
- override this with <tt>:default_permission => :allow</tt>, e.g.
108
- role 'admin', :default_permission => :allow
43
+ You can protect all actions in a controller through an Aegis resource with a single line:
109
44
 
110
- === Permissions
45
+ class ProjectsController
46
+ permissions :projects
47
+ end
111
48
 
112
- Permissions are specified with the *permission* method and *allow* and *deny*
113
- permission :do_something do
114
- allow :role_a, :role_b
115
- deny :role_c
116
- end
117
49
 
118
- Your user model just received two methods called <b>User#may_do_something?</b>
119
- and <b>User#may_do_something!</b>. The first one with the ? returns true for users with
120
- +role_a+ and +role_b+, and false for users with +role_c+. The second one with the ! raises an
121
- Aegis::PermissionError for +role_c+.
122
-
123
- === Normalization
124
-
125
- Aegis will perform some normalization. For example, the permissions
126
- +edit_something+ and +update_something+ will be the same, each granting both
127
- <tt>may_edit_something?</tt> and <tt>may_update_something?</tt>. The following normalizations
128
- are active:
129
- * edit = update
130
- * show = list = view = read
131
- * delete = remove = destroy
132
-
133
- === Complex permissions (with parameters)
134
-
135
- *allow* and *deny* can also take a block that may return +true+ or +false+
136
- indicating if this really applies. So
137
- permission :pull_april_fools_prank do
138
- allow :everyone do
139
- Date.today.month == 4 and Date.today.day == 1
140
- end
141
- end
142
- will generate a <tt>may_pull_april_fools_prank?</tt> method that only returns true on
143
- April 1.
144
-
145
- This becomes more useful if you pass parameters to a <tt>may_...?</tt> method, which
146
- are passed through to the permission block (together with the user object). This
147
- way you can define more complex permissions like
148
- permission :edit_post do |current_user, post|
149
- allow :registered_user do
150
- post.owner == current_user
151
- end
152
- allow :admin
153
- end
154
- which will permit admins and post owners to edit posts.
50
+ == Further reading
155
51
 
156
- === For your convenience
52
+ You are now familiar with the basic use case. Aegis can do a *lot* more than that.
53
+ There is an awesome {documentation wiki}[http://wiki.github.com/makandra/aegis/] with detailled information on many basic and advanced topics, including:
157
54
 
158
- As a convenience, if you create a permission ending in a plural 's', this
159
- automatically includes the singular form. That is, after
160
- permission :read_posts do
161
- allow :everyone
162
- end
163
- <tt>.may_read_post? @post</tt> will return true, as well.
55
+ * {Defining roles and basic permissions}[http://wiki.github.com/makandra/aegis/defining-roles-and-basic-permissions]
56
+ * {Checking permissions}[http://wiki.github.com/makandra/aegis/checking-permissions]
57
+ * {Giving your user model a role}[http://wiki.github.com/makandra/aegis/giving-your-user-model-a-role]
58
+ * {Defining permissions with resources}[http://wiki.github.com/makandra/aegis/defining-permissions-with-resources]
59
+ * {Controller integration}[http://wiki.github.com/makandra/aegis/controller-integration]
60
+ * {Giving default access to superusers}[http://wiki.github.com/makandra/aegis/giving-default-access-to-superusers]
61
+ * {Distinguishing between reading and writing actions}[http://wiki.github.com/makandra/aegis/distinguishing-between-reading-and-writing-actions]
62
+ * {Aliasing actions}[http://wiki.github.com/makandra/aegis/aliasing-actions]
63
+ * {Checking permissions when no user is signed in}[http://wiki.github.com/makandra/aegis/checking-permissions-when-no-user-is-signed-in]
64
+ * {Handling denied permissions in your controllers}[http://wiki.github.com/makandra/aegis/handling-denied-permissions-in-your-controllers]
65
+ * {Changing behavior when a permission is undefined}[http://wiki.github.com/makandra/aegis/changing-behavior-when-a-permission-is-undefined]
66
+ * {Multiple roles per user}[http://wiki.github.com/makandra/aegis/multiple-roles-per-user]
67
+ * {Upgrading to Aegis 2}[http://wiki.github.com/makandra/aegis/upgrading-to-aegis-2]
164
68
 
165
- If you want to grant +create_something+, +read_something+, +update_something+
166
- and +destroy_something+ permissions all at once, just use
167
- permission :crud_something do
168
- allow :admin
169
- end
170
-
171
- If several permission blocks (or several allow and denies) apply to a certain
172
- role, the later one always wins. That is
173
- permission :do_something do
174
- deny :everyone
175
- allow :admin
176
- end
177
- will work as expected.
178
69
 
179
- === Our stance on multiple roles per user
70
+ == Installation
180
71
 
181
- We believe that you should only distinguish roles that have different ways of resolving their permissions. A typical set of roles would be
72
+ Add the following to your <tt>Initializer.run</tt> block in your <tt>environment.rb</tt>:
73
+ config.gem 'aegis', :source => 'http://gemcutter.org'
74
+ Then do a
75
+ sudo rake gems:install
182
76
 
183
- * anonymous guest (has access to nothing with some exceptions)
184
- * signed up user (has access to some things depending on its attributes and associations)
185
- * administrator (has access to everything)
77
+ Alternatively, use
78
+ sudo gem sources -a http://gemcutter.org
79
+ sudo gem install aegis
186
80
 
187
- We don't do multiple, parametrized roles like "leader for project #2" and "author of post #7".
188
- That would be reinventing associations. Just use a single :user role and let your permission block
189
- query regular associations and attributes.
190
81
 
191
- === Credits
82
+ == Credits
192
83
 
193
84
  Henning Koch, Tobias Kraze
194
85
 
195
- {link www.makandra.de}[http://www.makandra.de/]
86
+ {gem-session.com}[http://gem-session.com/]
87
+
88
+ {www.makandra.de}[http://www.makandra.de/]
data/Rakefile CHANGED
@@ -1,26 +1,34 @@
1
1
  require 'rake'
2
- require 'rake/testtask'
2
+ require 'rake/rdoctask'
3
+ require 'spec/rake/spectask'
3
4
 
4
- desc 'Default: run unit tests.'
5
- task :default => :test
5
+ desc 'Default: Run Aegis specs'
6
+ task :default => :spec
6
7
 
7
- desc 'Test the aegis gem.'
8
- Rake::TestTask.new(:test) do |t|
9
- t.libs << 'lib'
10
- t.pattern = 'test/**/*_test.rb'
11
- t.verbose = true
8
+ desc "Run Aegis specs"
9
+ Spec::Rake::SpecTask.new() do |t|
10
+ t.spec_opts = ['--options', "\"spec/spec.opts\""]
11
+ t.spec_files = FileList['spec/**/*_spec.rb']
12
12
  end
13
13
 
14
+ desc 'Generate documentation for the Aegis gem'
15
+ Rake::RDocTask.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'Aegis'
18
+ rdoc.options << '--line-numbers' << '--inline-source'
19
+ rdoc.rdoc_files.include('README')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
14
22
 
15
23
  begin
16
24
  require 'jeweler'
17
25
  Jeweler::Tasks.new do |gemspec|
18
26
  gemspec.name = "aegis"
19
- gemspec.summary = "Role-based permissions for your user models."
20
- gemspec.email = "github@makandra.de"
27
+ gemspec.summary = "Complete authorization solution for Rails"
28
+ gemspec.email = "henning.koch@makandra.de"
21
29
  gemspec.homepage = "http://github.com/makandra/aegis"
22
- gemspec.description = "Aegis is a role-based permission system, where all users are given a role. It is possible to define detailed and complex permissions for each role very easily."
23
- gemspec.authors = ["Henning Koch"]
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
+ gemspec.authors = ["Henning Koch", "Tobias Kraze"]
24
32
  end
25
33
  rescue LoadError
26
34
  puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.8
1
+ 2.0.0
data/aegis.gemspec CHANGED
@@ -1,77 +1,106 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "aegis"
8
- s.version = "1.1.8"
7
+ s.name = %q{aegis}
8
+ s.version = "2.0.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Henning Koch"]
12
- s.date = "2014-05-28"
13
- s.description = "Aegis is a role-based permission system, where all users are given a role. It is possible to define detailed and complex permissions for each role very easily."
14
- s.email = "github@makandra.de"
11
+ s.authors = ["Henning Koch", "Tobias Kraze"]
12
+ s.date = %q{2010-05-02}
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
+ s.email = %q{henning.koch@makandra.de}
15
15
  s.extra_rdoc_files = [
16
16
  "README.rdoc"
17
17
  ]
18
18
  s.files = [
19
- "MIT-LICENSE",
20
- "README.rdoc",
21
- "Rakefile",
22
- "VERSION",
23
- "aegis.gemspec",
24
- "lib/aegis.rb",
25
- "lib/aegis/constants.rb",
26
- "lib/aegis/has_role.rb",
27
- "lib/aegis/normalization.rb",
28
- "lib/aegis/permission_error.rb",
29
- "lib/aegis/permission_evaluator.rb",
30
- "lib/aegis/permissions.rb",
31
- "lib/aegis/role.rb",
32
- "lib/rails/active_record.rb",
33
- "test/app_root/app/controllers/application_controller.rb",
34
- "test/app_root/app/models/old_soldier.rb",
35
- "test/app_root/app/models/permissions.rb",
36
- "test/app_root/app/models/soldier.rb",
37
- "test/app_root/app/models/trust_fund_kid.rb",
38
- "test/app_root/app/models/user.rb",
39
- "test/app_root/app/models/user_subclass.rb",
40
- "test/app_root/app/models/veteran_soldier.rb",
41
- "test/app_root/config/boot.rb",
42
- "test/app_root/config/database.yml",
43
- "test/app_root/config/environment.rb",
44
- "test/app_root/config/environments/in_memory.rb",
45
- "test/app_root/config/environments/mysql.rb",
46
- "test/app_root/config/environments/postgresql.rb",
47
- "test/app_root/config/environments/sqlite.rb",
48
- "test/app_root/config/environments/sqlite3.rb",
49
- "test/app_root/config/routes.rb",
50
- "test/app_root/db/migrate/20090408115228_create_users.rb",
51
- "test/app_root/db/migrate/20090429075648_create_soldiers.rb",
52
- "test/app_root/db/migrate/20091110075648_create_veteran_soldiers.rb",
53
- "test/app_root/db/migrate/20091110075649_create_trust_fund_kids.rb",
54
- "test/app_root/lib/console_with_fixtures.rb",
55
- "test/app_root/log/.gitignore",
56
- "test/app_root/script/console",
57
- "test/has_role_options_test.rb",
58
- "test/has_role_test.rb",
59
- "test/permissions_test.rb",
60
- "test/test_helper.rb",
61
- "test/validation_test.rb"
19
+ ".gitignore",
20
+ "MIT-LICENSE",
21
+ "README.rdoc",
22
+ "Rakefile",
23
+ "VERSION",
24
+ "aegis.gemspec",
25
+ "lib/aegis.rb",
26
+ "lib/aegis/access_denied.rb",
27
+ "lib/aegis/action.rb",
28
+ "lib/aegis/compiler.rb",
29
+ "lib/aegis/has_role.rb",
30
+ "lib/aegis/parser.rb",
31
+ "lib/aegis/permissions.rb",
32
+ "lib/aegis/resource.rb",
33
+ "lib/aegis/role.rb",
34
+ "lib/aegis/sieve.rb",
35
+ "lib/rails/action_controller.rb",
36
+ "lib/rails/active_record.rb",
37
+ "spec/action_controller_spec.rb",
38
+ "spec/app_root/app/controllers/application_controller.rb",
39
+ "spec/app_root/app/controllers/reviews_controller.rb",
40
+ "spec/app_root/app/models/permissions.rb",
41
+ "spec/app_root/app/models/property.rb",
42
+ "spec/app_root/app/models/review.rb",
43
+ "spec/app_root/app/models/user.rb",
44
+ "spec/app_root/config/boot.rb",
45
+ "spec/app_root/config/database.yml",
46
+ "spec/app_root/config/environment.rb",
47
+ "spec/app_root/config/environments/in_memory.rb",
48
+ "spec/app_root/config/environments/mysql.rb",
49
+ "spec/app_root/config/environments/postgresql.rb",
50
+ "spec/app_root/config/environments/sqlite.rb",
51
+ "spec/app_root/config/environments/sqlite3.rb",
52
+ "spec/app_root/config/routes.rb",
53
+ "spec/app_root/db/migrate/001_create_users.rb",
54
+ "spec/app_root/db/migrate/002_create_properties.rb",
55
+ "spec/app_root/db/migrate/003_create_reviews.rb",
56
+ "spec/app_root/lib/console_with_fixtures.rb",
57
+ "spec/app_root/log/.gitignore",
58
+ "spec/app_root/script/console",
59
+ "spec/controllers/reviews_controller_spec.rb",
60
+ "spec/has_role_spec.rb",
61
+ "spec/permissions_spec.rb",
62
+ "spec/rcov.opts",
63
+ "spec/spec.opts",
64
+ "spec/spec_helper.rb"
62
65
  ]
63
- s.homepage = "http://github.com/makandra/aegis"
66
+ s.homepage = %q{http://github.com/makandra/aegis}
67
+ s.rdoc_options = ["--charset=UTF-8"]
64
68
  s.require_paths = ["lib"]
65
- s.rubygems_version = "1.8.25"
66
- s.summary = "Role-based permissions for your user models."
69
+ s.rubygems_version = %q{1.3.5}
70
+ s.summary = %q{Complete authorization solution for Rails}
71
+ s.test_files = [
72
+ "spec/app_root/app/models/user.rb",
73
+ "spec/app_root/app/models/property.rb",
74
+ "spec/app_root/app/models/review.rb",
75
+ "spec/app_root/app/models/permissions.rb",
76
+ "spec/app_root/app/controllers/application_controller.rb",
77
+ "spec/app_root/app/controllers/reviews_controller.rb",
78
+ "spec/app_root/config/boot.rb",
79
+ "spec/app_root/config/environment.rb",
80
+ "spec/app_root/config/environments/in_memory.rb",
81
+ "spec/app_root/config/environments/mysql.rb",
82
+ "spec/app_root/config/environments/postgresql.rb",
83
+ "spec/app_root/config/environments/sqlite.rb",
84
+ "spec/app_root/config/environments/sqlite3.rb",
85
+ "spec/app_root/config/routes.rb",
86
+ "spec/app_root/db/migrate/001_create_users.rb",
87
+ "spec/app_root/db/migrate/002_create_properties.rb",
88
+ "spec/app_root/db/migrate/003_create_reviews.rb",
89
+ "spec/app_root/lib/console_with_fixtures.rb",
90
+ "spec/action_controller_spec.rb",
91
+ "spec/has_role_spec.rb",
92
+ "spec/permissions_spec.rb",
93
+ "spec/spec_helper.rb",
94
+ "spec/controllers/reviews_controller_spec.rb"
95
+ ]
67
96
 
68
97
  if s.respond_to? :specification_version then
98
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
69
99
  s.specification_version = 3
70
100
 
71
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
101
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
72
102
  else
73
103
  end
74
104
  else
75
105
  end
76
106
  end
77
-