cancancan 1.8.0 → 1.14.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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +12 -11
  3. data/Appraisals +23 -16
  4. data/CHANGELOG.rdoc +75 -0
  5. data/CONTRIBUTING.md +2 -2
  6. data/README.md +217 -0
  7. data/cancancan.gemspec +5 -8
  8. data/gemfiles/{activerecord_3.1.gemfile → activerecord_4.0.gemfile} +2 -1
  9. data/gemfiles/{activerecord_3.0.gemfile → activerecord_4.1.gemfile} +2 -3
  10. data/gemfiles/activerecord_4.2.gemfile +18 -0
  11. data/gemfiles/sequel_3.x.gemfile +0 -1
  12. data/lib/cancan/ability.rb +94 -17
  13. data/lib/cancan/controller_additions.rb +1 -1
  14. data/lib/cancan/controller_resource.rb +32 -24
  15. data/lib/cancan/matchers.rb +29 -6
  16. data/lib/cancan/model_adapters/active_record_3_adapter.rb +16 -0
  17. data/lib/cancan/model_adapters/active_record_4_adapter.rb +55 -0
  18. data/lib/cancan/model_adapters/active_record_adapter.rb +9 -41
  19. data/lib/cancan/model_adapters/mongoid_adapter.rb +23 -2
  20. data/lib/cancan/rule.rb +10 -5
  21. data/lib/cancan/version.rb +1 -1
  22. data/lib/cancan.rb +11 -2
  23. data/lib/generators/cancan/ability/templates/ability.rb +1 -1
  24. data/spec/README.rdoc +2 -2
  25. data/spec/cancan/ability_spec.rb +174 -111
  26. data/spec/cancan/controller_additions_spec.rb +8 -8
  27. data/spec/cancan/controller_resource_spec.rb +96 -79
  28. data/spec/cancan/model_adapters/active_record_4_adapter_spec.rb +154 -0
  29. data/spec/cancan/model_adapters/active_record_adapter_spec.rb +92 -64
  30. data/spec/cancan/model_adapters/mongoid_adapter_spec.rb +26 -6
  31. data/spec/cancan/model_adapters/sequel_adapter_spec.rb +49 -65
  32. data/spec/matchers.rb +2 -2
  33. data/spec/spec_helper.rb +3 -2
  34. metadata +19 -40
  35. data/README.rdoc +0 -183
  36. data/gemfiles/datamapper_1.x.gemfile +0 -10
  37. data/lib/cancan/model_adapters/data_mapper_adapter.rb +0 -34
  38. data/spec/cancan/model_adapters/data_mapper_adapter_spec.rb +0 -119
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7079b16052c2f98ebe67d6ce08e390188bca856d
4
- data.tar.gz: faa43141ca3124dbe3d40ceb30a76ca78bc56117
3
+ metadata.gz: 597f9c67d00dc9af7805456aca9464c41b795f42
4
+ data.tar.gz: e52df51e0f69a1f98509e7d8ae7ab8e14affb418
5
5
  SHA512:
6
- metadata.gz: 8168024035574501d8bef61033f458facb1b7173ed98d901b9b51aedc0c659470f6210beb308273de9cd437e4d75027eb39321f104a9e8dc8f933593f1a67aa1
7
- data.tar.gz: e71e7aa4f2a66f0f660aa9ce224dff3c0de2efc3b0fb85d461113175e5349700bf4475f5f9ca7abf16c56457488a33b3b5d954e753b021f162428c5827e28cd5
6
+ metadata.gz: df305f2d2c391e2ce49bf98f0cdbe6b0cc0d96140467bb3efa66032ce61fe0ada2984ab94bfc956fbd5a8e3d1251ae7f64e3fe5773a815d172abb62f5f71db18
7
+ data.tar.gz: 33dcb0f4db08c07cf7e62103588177c628ddf7f8e219495b2e74bec94c9e2608c9b38daf2009626ef51aa77e97f6cdfc4c12d08a946f2c41d2b99e7385a8e7ea
data/.travis.yml CHANGED
@@ -1,24 +1,25 @@
1
+ language: ruby
2
+ cache: bundler
3
+ sudo: false
1
4
  rvm:
2
- - 1.8.7
3
- - 1.9.2
4
- - 1.9.3
5
5
  - 2.0.0
6
6
  - 2.1.0
7
- - ree
8
- - jruby
9
- - rbx
7
+ - 2.2.0
8
+ - jruby-9.0.5.0
10
9
  gemfile:
11
- - gemfiles/activerecord_3.0.gemfile
12
- - gemfiles/activerecord_3.1.gemfile
13
10
  - gemfiles/activerecord_3.2.gemfile
14
- - gemfiles/datamapper_1.x.gemfile
11
+ - gemfiles/activerecord_4.0.gemfile
12
+ - gemfiles/activerecord_4.1.gemfile
13
+ - gemfiles/activerecord_4.2.gemfile
15
14
  - gemfiles/mongoid_2.x.gemfile
16
15
  - gemfiles/sequel_3.x.gemfile
17
16
  services:
18
17
  - mongodb
19
18
  matrix:
20
- allow_failures:
21
- - rvm: rbx
19
+ fast_finish: true
20
+ exclude:
21
+ - rvm: 2.2.0
22
+ gemfile: gemfiles/activerecord_3.2.gemfile
22
23
  notifications:
23
24
  recipients:
24
25
  - bryan@bryanrite.com
data/Appraisals CHANGED
@@ -1,7 +1,5 @@
1
- appraise "activerecord_3.0" do
2
- gem "activerecord", "~> 3.0.20", :require => "active_record"
3
- gem 'activesupport', '~> 3.0.20', :require => 'active_support/all'
4
- gem "meta_where"
1
+ appraise "activerecord_3.2" do
2
+ gem "activerecord", "~> 3.2.0", :require => "active_record"
5
3
 
6
4
  gemfile.platforms :jruby do
7
5
  gem "activerecord-jdbcsqlite3-adapter"
@@ -13,8 +11,9 @@ appraise "activerecord_3.0" do
13
11
  end
14
12
  end
15
13
 
16
- appraise "activerecord_3.1" do
17
- gem "activerecord", "~> 3.1.0", :require => "active_record"
14
+ appraise "activerecord_4.0" do
15
+ gem "activerecord", "~> 4.0.5", :require => "active_record"
16
+ gem "activesupport", "~> 4.0.5", :require => "active_support/all"
18
17
 
19
18
  gemfile.platforms :jruby do
20
19
  gem "activerecord-jdbcsqlite3-adapter"
@@ -26,8 +25,9 @@ appraise "activerecord_3.1" do
26
25
  end
27
26
  end
28
27
 
29
- appraise "activerecord_3.2" do
30
- gem "activerecord", "~> 3.2.0", :require => "active_record"
28
+ appraise "activerecord_4.1" do
29
+ gem "activerecord", "~> 4.1.1", :require => "active_record"
30
+ gem "activesupport", "~> 4.1.1", :require => "active_support/all"
31
31
 
32
32
  gemfile.platforms :jruby do
33
33
  gem "activerecord-jdbcsqlite3-adapter"
@@ -39,15 +39,23 @@ appraise "activerecord_3.2" do
39
39
  end
40
40
  end
41
41
 
42
- appraise "datamapper_1.x" do
43
- gem 'activesupport', '~> 3.0', :require => 'active_support/all'
44
- gem "dm-core", "~> 1.0.2"
45
- gem "dm-sqlite-adapter", "~> 1.0.2"
46
- gem "dm-migrations", "~> 1.0.2"
42
+ appraise "activerecord_4.2" do
43
+ gem "activerecord", "~> 4.2.0", :require => "active_record"
44
+ gem 'activesupport', '~> 4.2.0', :require => 'active_support/all'
45
+
46
+ gemfile.platforms :jruby do
47
+ gem "activerecord-jdbcsqlite3-adapter"
48
+ gem "jdbc-sqlite3"
49
+ end
50
+
51
+ gemfile.platforms :ruby, :mswin, :mingw do
52
+ gem "sqlite3"
53
+ gem "pg"
54
+ end
47
55
  end
48
56
 
49
57
  appraise "mongoid_2.x" do
50
- gem 'activesupport', '~> 3.0', :require => 'active_support/all'
58
+ gem "activesupport", "~> 3.0", :require => "active_support/all"
51
59
  gem "mongoid", "~> 2.0.0"
52
60
 
53
61
  gemfile.platforms :ruby, :mswin, :mingw do
@@ -61,10 +69,9 @@ end
61
69
 
62
70
  appraise "sequel_3.x" do
63
71
  gem "sequel", "~> 3.47.0"
64
- gem 'activesupport', '~> 3.0', :require => 'active_support/all'
72
+ gem "activesupport", "~> 3.0", :require => "active_support/all"
65
73
 
66
74
  gemfile.platforms :jruby do
67
- gem "activerecord-jdbcsqlite3-adapter"
68
75
  gem "jdbc-sqlite3"
69
76
  end
70
77
 
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,80 @@
1
1
  Develop
2
2
 
3
+ Unreleased
4
+
5
+ * Add support for rails 4 enum's (markpmitchell)
6
+
7
+ 1.13.1 (Oct 8th, 2015)
8
+
9
+ * Fix #merge with empty Ability (jhawthorn)
10
+
11
+ 1.13.0 (Oct 7th, 2015)
12
+
13
+ * Significantly improve rule lookup time (amarshall)
14
+ * Removed deprecation warnings for RSpec 3.2 (NekoNova)
15
+
16
+ 1.12.0 (June 28th, 2015)
17
+
18
+ * Add a permissions method to Ability (devaroop)
19
+
20
+ 1.11.0 (June 15th, 2015)
21
+
22
+ * Complete cancancan#115 - Specify authorization action for parent resources. (phallguy)
23
+
24
+ 1.10.1 (January 13th, 2015)
25
+
26
+ * Fix cancancan#168 - A bug with ActiveRecord 4.2 support causing ProtocolViolation due to named parameters not being passed in.
27
+
28
+
29
+ 1.10.0 (January 7th, 2015)
30
+
31
+ * Fix i18n issue for Ruby < 1.9.3 (bryanrite)
32
+
33
+ * Fix cancancan#149 - Fix an issue loading namespaced models (darthjee)
34
+
35
+ * Fix cancancan#160 - Support for Rails 4.2 (marshall-lee)
36
+
37
+ * Fix cancancan#153 - More useful output in ability spec matchers (jondkinney)
38
+
39
+
40
+ 1.9.2 (August 8th, 2014)
41
+
42
+ * Fix cancancan#77, 78 - Fix an issue with associations for namespaced models. (jjp)
43
+
44
+
45
+ 1.9.1 (July 21st, 2014)
46
+
47
+ * Fix cancancan#101 - Fixes an issue where overjealous use of references would cause issues with scopes when loading associations. (bryanrite)
48
+
49
+
50
+ 1.9.0 (July 20th, 2014)
51
+
52
+ * Fix cancancan#59 - Parameters are automatically detected and santitized for all actions, not just create and update. (bryanrite)
53
+
54
+ * Fix cancancan#97, 72, 40, 39, 26 - Support Active Record 4 properly with references on nested permissions. (scpike, tdg5, Crystark)
55
+
56
+
57
+ 1.8.4 (June 24th, 2014)
58
+
59
+ * Fix cancancan#86 - Fixes previous RSpec 3 update as there was a bug in the fix for RSpec 2.99. (bryanrite)
60
+
61
+
62
+ 1.8.3 (June 24th, 2014)
63
+
64
+ * Fix cancancan#85 - Remove deprecation notices for RSpec 3 and continue backwards compatibility. (andypike, bryanrite, porteta)
65
+
66
+
67
+ 1.8.2 (June 5th, 2014)
68
+
69
+ * Fix cancancan#75 - More specific hash-like object check. (bryanrite)
70
+
71
+
72
+ 1.8.1 (May 27th, 2014)
73
+
74
+ * Fix cancancan#67 - Sequel tests are run properly for JRuby. (bryanrite)
75
+
76
+ * Fix cancancan#68 - Checks for hash-like objects in subject better. (bryanrite)
77
+
3
78
 
4
79
  1.8.0 (May 8th, 2014)
5
80
 
data/CONTRIBUTING.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  ### Reporting an Issue
4
4
 
5
- 1. If you have any questions about CanCanCan, search the [Wiki](https://github.com/bryanrite/cancancan/wiki), use [Stack Overflow](http://stackoverflow.com/questions/tagged/cancancan), or [our mailing list](https://groups.google.com/forum/#!forum/cancancan). Do not post questions here.
5
+ 1. If you have any questions about CanCanCan, search the [Wiki](https://github.com/cancancommunity/cancancan/wiki), use [Stack Overflow](http://stackoverflow.com/questions/tagged/cancancan), or [our mailing list](https://groups.google.com/forum/#!forum/cancancan). Do not post questions here.
6
6
 
7
- 1. If you find a security bug, **DO NOT** submit an issue here. Please send an e-mail to [bryan@bryanrite.com](mailto:bryan@bryanrite.com) instead.
7
+ 1. If you find a security bug, **DO NOT** submit an issue here. Please send an e-mail to the current maintainer instead.
8
8
 
9
9
  1. Do a small search on the issues tracker before submitting your issue to see if it was already reported / fixed.
10
10
 
data/README.md ADDED
@@ -0,0 +1,217 @@
1
+ # CanCanCan
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/cancancan.svg)](http://badge.fury.io/rb/cancancan)
4
+ [![Travis badge](https://travis-ci.org/CanCanCommunity/cancancan.svg?branch=develop)](https://travis-ci.org/CanCanCommunity/cancancan)
5
+ [![Code Climate Badge](https://codeclimate.com/github/CanCanCommunity/cancancan.svg)](https://codeclimate.com/github/CanCanCommunity/cancancan)
6
+ [![Inch CI](http://inch-ci.org/github/CanCanCommunity/cancancan.svg)](http://inch-ci.org/github/CanCanCommunity/cancancan)
7
+
8
+ [Wiki](https://github.com/CanCanCommunity/cancancan/wiki) | [RDocs](http://rdoc.info/projects/CanCanCommunity/cancancan) | [Screencast](http://railscasts.com/episodes/192-authorization-with-cancan) | [IRC: #cancancan (freenode)](http://webchat.freenode.net/?channels=cancancan)
9
+
10
+ CanCan is an authorization library for Ruby on Rails which restricts what resources a given user is allowed to access. All permissions are defined in a single location (the `Ability` class) and not duplicated across controllers, views, and database queries.
11
+
12
+ ## This is the master branch!
13
+ This branch represents work towards version 2.0. Please checkout the 1.x branch for the stable release. Use master at your own risk.
14
+
15
+ ## Mission
16
+
17
+ This repo is a continuation of the dead [CanCan](https://github.com/ryanb/cancan) project. Our mission is to keep CanCan alive and moving forward, with maintenance fixes and new features. Pull Requests are welcome!
18
+
19
+ I am currently focusing on the 1.x branch for the immediate future, making sure it is up to date as well as ensuring compatibility with Rails 4+. I will take a look into the 2.x branch and try to see what improvements, reorganizations and redesigns Ryan was attempting and go forward from there.
20
+
21
+ Any help is greatly appreciated, feel free to submit pull-requests or open issues.
22
+
23
+
24
+ ## Installation
25
+
26
+ In **Rails 3 and 4**, add this to your Gemfile and run the `bundle install` command.
27
+
28
+ gem 'cancancan', '~> 1.10'
29
+
30
+ ## Getting Started
31
+
32
+ CanCanCan expects a `current_user` method to exist in the controller. First, set up some authentication (such as [Authlogic](https://github.com/binarylogic/authlogic) or [Devise](https://github.com/plataformatec/devise)). See [Changing Defaults](https://github.com/CanCanCommunity/cancancan/wiki/changing-defaults) if you need different behavior.
33
+
34
+ When using [rails-api](https://github.com/rails-api/rails-api), you have to manually include the controller methods for CanCan:
35
+ ```ruby
36
+ class ApplicationController < ActionController::API
37
+ include CanCan::ControllerAdditions
38
+ end
39
+ ```
40
+
41
+ ### 1. Define Abilities
42
+
43
+ User permissions are defined in an `Ability` class. CanCan 1.5 includes a Rails 3 and 4 generator for creating this class.
44
+
45
+ rails g cancan:ability
46
+
47
+ In Rails 2.3, just add a new class in `app/models/ability.rb` with the following contents:
48
+
49
+ ```ruby
50
+ class Ability
51
+ include CanCan::Ability
52
+
53
+ def initialize(user)
54
+ end
55
+ end
56
+ ```
57
+
58
+ See [Defining Abilities](https://github.com/CanCanCommunity/cancancan/wiki/defining-abilities) for details.
59
+
60
+
61
+ ### 2. Check Abilities & Authorization
62
+
63
+ The current user's permissions can then be checked using the `can?` and `cannot?` methods in the view and controller.
64
+
65
+ ```erb
66
+ <% if can? :update, @article %>
67
+ <%= link_to "Edit", edit_article_path(@article) %>
68
+ <% end %>
69
+ ```
70
+
71
+ See [Checking Abilities](https://github.com/CanCanCommunity/cancancan/wiki/checking-abilities) for more information
72
+
73
+ The `authorize!` method in the controller will raise an exception if the user is not able to perform the given action.
74
+
75
+ ```ruby
76
+ def show
77
+ @article = Article.find(params[:id])
78
+ authorize! :read, @article
79
+ end
80
+ ```
81
+
82
+ Setting this for every action can be tedious, therefore the `load_and_authorize_resource` method is provided to automatically authorize all actions in a RESTful style resource controller. It will use a before filter to load the resource into an instance variable and authorize it for every action.
83
+
84
+ ```ruby
85
+ class ArticlesController < ApplicationController
86
+ load_and_authorize_resource
87
+
88
+ def show
89
+ # @article is already loaded and authorized
90
+ end
91
+ end
92
+ ```
93
+
94
+ See [Authorizing Controller Actions](https://github.com/CanCanCommunity/cancancan/wiki/authorizing-controller-actions) for more information.
95
+
96
+
97
+ #### Strong Parameters
98
+
99
+ When using `strong_parameters` or Rails 4+, you have to sanitize inputs before saving the record, in actions such as `:create` and `:update`.
100
+
101
+ For the `:update` action, CanCan will load and authorize the resource but *not* change it automatically, so the typical usage would be something like:
102
+
103
+ ```ruby
104
+ def update
105
+ if @article.update_attributes(update_params)
106
+ # hurray
107
+ else
108
+ render :edit
109
+ end
110
+ end
111
+ ...
112
+
113
+ def update_params
114
+ params.require(:article).permit(:body)
115
+ end
116
+ ```
117
+
118
+ For the `:create` action, CanCan will try to initialize a new instance with sanitized input by seeing if your controller will respond to the following methods (in order):
119
+
120
+ 1. `create_params`
121
+ 2. `<model_name>_params` such as `article_params` (this is the default convention in rails for naming your param method)
122
+ 3. `resource_params` (a generically named method you could specify in each controller)
123
+
124
+ Additionally, `load_and_authorize_resource` can now take a `param_method` option to specify a custom method in the controller to run to sanitize input.
125
+
126
+ You can associate the `param_method` option with a symbol corresponding to the name of a method that will get called:
127
+
128
+ ```ruby
129
+ class ArticlesController < ApplicationController
130
+ load_and_authorize_resource param_method: :my_sanitizer
131
+
132
+ def create
133
+ if @article.save
134
+ # hurray
135
+ else
136
+ render :new
137
+ end
138
+ end
139
+
140
+ private
141
+
142
+ def my_sanitizer
143
+ params.require(:article).permit(:name)
144
+ end
145
+ end
146
+ ```
147
+
148
+ You can also use a string that will be evaluated in the context of the controller using `instance_eval` and needs to contain valid Ruby code. This does come in handy when using a PermittedParams class as suggested in Railscast 371:
149
+
150
+ load_and_authorize_resource param_method: 'permitted_params.article'
151
+
152
+ Finally, it's possible to associate `param_method` with a Proc object which will be called with the controller as the only argument:
153
+
154
+ load_and_authorize_resource param_method: Proc.new { |c| c.params.require(:article).permit(:name) }
155
+
156
+ See [Strong Parameters](https://github.com/CanCanCommunity/cancancan/wiki/Strong-Parameters) for more information.
157
+
158
+ ### 3. Handle Unauthorized Access
159
+
160
+ If the user authorization fails, a `CanCan::AccessDenied` exception will be raised. You can catch this and modify its behavior in the `ApplicationController`.
161
+
162
+ ```ruby
163
+ class ApplicationController < ActionController::Base
164
+ rescue_from CanCan::AccessDenied do |exception|
165
+ redirect_to root_url, :alert => exception.message
166
+ end
167
+ end
168
+ ```
169
+
170
+ See [Exception Handling](https://github.com/CanCanCommunity/cancancan/wiki/exception-handling) for more information.
171
+
172
+
173
+ ### 4. Lock It Down
174
+
175
+ If you want to ensure authorization happens on every action in your application, add `check_authorization` to your `ApplicationController`.
176
+
177
+ ```ruby
178
+ class ApplicationController < ActionController::Base
179
+ check_authorization
180
+ end
181
+ ```
182
+
183
+ This will raise an exception if authorization is not performed in an action. If you want to skip this, add `skip_authorization_check` to a controller subclass. See [Ensure Authorization](https://github.com/CanCanCommunity/cancancan/wiki/Ensure-Authorization) for more information.
184
+
185
+
186
+ ## Wiki Docs
187
+
188
+ * [Upgrading to 1.6](https://github.com/CanCanCommunity/cancancan/wiki/Upgrading-to-1.6)
189
+ * [Defining Abilities](https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities)
190
+ * [Checking Abilities](https://github.com/CanCanCommunity/cancancan/wiki/Checking-Abilities)
191
+ * [Authorizing Controller Actions](https://github.com/CanCanCommunity/cancancan/wiki/Authorizing-Controller-Actions)
192
+ * [Exception Handling](https://github.com/CanCanCommunity/cancancan/wiki/Exception-Handling)
193
+ * [Changing Defaults](https://github.com/CanCanCommunity/cancancan/wiki/Changing-Defaults)
194
+ * [See more](https://github.com/CanCanCommunity/cancancan/wiki)
195
+
196
+ ## Questions?
197
+ If you have any question or doubt regarding CanCanCan which you cannot find the solution to in the [documentation](https://github.com/CanCanCommunity/cancancan/wiki) or our [mailing list](http://groups.google.com/group/cancancan), please [open a question on Stackoverflow](http://stackoverflow.com/questions/ask?tags=cancancan) with tag [cancancan](http://stackoverflow.com/questions/tagged/cancancan)
198
+
199
+ ## Bugs?
200
+
201
+ If you find a bug please add an [issue on GitHub](https://github.com/CanCanCommunity/cancancan/issues) or fork the project and send a pull request.
202
+
203
+
204
+ ## Development
205
+
206
+ Cancancan uses [appraisals](https://github.com/thoughtbot/appraisal) to test the code base against multiple versions of Rails, as well as the different model adapters.
207
+
208
+ When first developing, you may need to run `bundle install` and then `appraisal install`, to install the different sets.
209
+
210
+ You can then run all appraisal files (like CI does), with `appraisal rake` or just run a specific set `appraisal activerecord_3.0 rake`.
211
+
212
+ See the [CONTRIBUTING](https://github.com/CanCanCommunity/cancancan/blob/develop/CONTRIBUTING.md) and [spec/README](https://github.com/CanCanCommunity/cancancan/blob/master/spec/README.rdoc) for more information.
213
+
214
+
215
+ ## Special Thanks
216
+
217
+ CanCan was inspired by [declarative_authorization](https://github.com/stffn/declarative_authorization/) and [aegis](https://github.com/makandra/aegis). Also many thanks to the [CanCan contributors](https://github.com/CanCanCommunity/cancancan/contributors). See the [CHANGELOG](https://github.com/CanCanCommunity/cancancan/blob/master/CHANGELOG.rdoc) for the full list.
data/cancancan.gemspec CHANGED
@@ -6,8 +6,8 @@ require 'cancan/version'
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "cancancan"
8
8
  s.version = CanCan::VERSION
9
- s.authors = ["Bryan Rite", "Ryan Bates"]
10
- s.email = "bryan@bryanrite.com"
9
+ s.authors = ["Bryan Rite", "Ryan Bates", "Richard Wilson"]
10
+ s.email = "r.crawfordwilson@gmail.com"
11
11
  s.homepage = "https://github.com/CanCanCommunity/cancancan"
12
12
  s.summary = "Simple authorization solution for Rails."
13
13
  s.description = "Continuation of the simple authorization solution for Rails which is decoupled from user roles. All permissions are stored in a single location."
@@ -19,13 +19,10 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split($/).map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
23
- s.required_rubygems_version = ">= 1.3.4"
22
+ s.required_ruby_version = ">= 2.0.0"
24
23
 
25
24
  s.add_development_dependency 'bundler', '~> 1.3'
26
25
  s.add_development_dependency 'rake', '~> 10.1.1'
27
- s.add_development_dependency 'rspec', '~> 2.14'
28
- s.add_development_dependency 'appraisal', '>= 1.0.0'
29
-
30
- s.rubyforge_project = s.name
26
+ s.add_development_dependency 'rspec', '~> 3.2.0'
27
+ s.add_development_dependency 'appraisal', '>= 2.0.0'
31
28
  end
@@ -2,7 +2,8 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "activerecord", "~> 3.1.0", :require => "active_record"
5
+ gem "activerecord", "~> 4.0.5", :require => "active_record"
6
+ gem "activesupport", "~> 4.0.5", :require => "active_support/all"
6
7
 
7
8
  platforms :jruby do
8
9
  gem "activerecord-jdbcsqlite3-adapter"
@@ -2,9 +2,8 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "activerecord", "~> 3.0.20", :require => "active_record"
6
- gem "activesupport", "~> 3.0.20", :require => "active_support/all"
7
- gem "meta_where"
5
+ gem "activerecord", "~> 4.1.1", :require => "active_record"
6
+ gem "activesupport", "~> 4.1.1", :require => "active_support/all"
8
7
 
9
8
  platforms :jruby do
10
9
  gem "activerecord-jdbcsqlite3-adapter"
@@ -0,0 +1,18 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 4.2.0", :require => "active_record"
6
+ gem "activesupport", "~> 4.2.0", :require => "active_support/all"
7
+
8
+ platforms :jruby do
9
+ gem "activerecord-jdbcsqlite3-adapter"
10
+ gem "jdbc-sqlite3"
11
+ end
12
+
13
+ platforms :ruby, :mswin, :mingw do
14
+ gem "sqlite3"
15
+ gem "pg"
16
+ end
17
+
18
+ gemspec :path => "../"
@@ -6,7 +6,6 @@ gem "sequel", "~> 3.47.0"
6
6
  gem "activesupport", "~> 3.0", :require => "active_support/all"
7
7
 
8
8
  platforms :jruby do
9
- gem "activerecord-jdbcsqlite3-adapter"
10
9
  gem "jdbc-sqlite3"
11
10
  end
12
11