Skip to content

Commit 8a85c0d

Browse files
committed
Merge branch 'release/2.0.0'
2 parents e633592 + da997d5 commit 8a85c0d

38 files changed

+283
-987
lines changed

.rubocop.yml

+6
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,15 @@ Metrics/ModuleLength:
3030
- 'lib/cancan/ability.rb'
3131
- 'lib/cancan/model_adapters/active_record_adapter.rb'
3232

33+
Metrics/BlockLength:
34+
Exclude:
35+
- 'lib/cancan/matchers.rb'
36+
- '**/*_spec.rb'
37+
3338
AllCops:
3439
TargetRubyVersion: 2.0
3540
Exclude:
3641
- 'gemfiles/vendor/bundle/**/*'
42+
- 'Appraisals'
3743

3844
inherit_from: .rubocop_todo.yml

.rubocop_todo.yml

+61-18
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,53 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2016-12-14 08:11:19 +0100 using RuboCop version 0.45.0.
3+
# on 2017-03-26 15:25:15 +0200 using RuboCop version 0.46.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 14
9+
# Offense count: 12
1010
Metrics/AbcSize:
11-
Max: 25
11+
Max: 21
12+
13+
# Offense count: 3
14+
# Configuration parameters: CountComments.
15+
Metrics/BlockLength:
16+
Max: 58
1217

13-
# Offense count: 5
18+
# Offense count: 4
1419
Metrics/CyclomaticComplexity:
1520
Max: 9
1621

17-
# Offense count: 14
22+
# Offense count: 13
1823
# Configuration parameters: CountComments.
1924
Metrics/MethodLength:
2025
Max: 21
2126

22-
23-
Metrics/BlockLength:
24-
Max: 28
25-
Exclude:
26-
- "**/*_spec.rb"
27-
28-
# Offense count: 7
27+
# Offense count: 4
2928
Metrics/PerceivedComplexity:
30-
Max: 11
29+
Max: 10
3130

32-
# TODO: due to mongoid. can't be fixed
33-
# Offense count: 1
34-
Performance/FixedSize:
31+
# Offense count: 3
32+
# Cop supports --auto-correct.
33+
# Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods.
34+
# SupportedStyles: line_count_based, semantic, braces_for_chaining
35+
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
36+
# FunctionalMethods: let, let!, subject, watch
37+
# IgnoredMethods: lambda, proc, it
38+
Style/BlockDelimiters:
3539
Exclude:
36-
- 'spec/cancan/model_adapters/mongoid_adapter_spec.rb'
40+
- 'spec/cancan/matchers_spec.rb'
3741

42+
# Offense count: 4
43+
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts.
44+
Style/FileName:
45+
Exclude:
46+
- 'spec/cancan/inherited_resource_spec_BACKUP_24010.rb'
47+
- 'spec/cancan/inherited_resource_spec_BASE_24010.rb'
48+
- 'spec/cancan/inherited_resource_spec_LOCAL_24010.rb'
49+
- 'spec/cancan/inherited_resource_spec_REMOTE_24010.rb'
3850

39-
# TODO: fixing this would change the APIs
4051
# Offense count: 2
4152
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
4253
# NamePrefix: is_, has_, have_
@@ -46,3 +57,35 @@ Style/PredicateName:
4657
Exclude:
4758
- 'spec/**/*'
4859
- 'lib/cancan/ability.rb'
60+
61+
# Offense count: 1
62+
# Cop supports --auto-correct.
63+
# Configuration parameters: EnforcedStyle, SupportedStyles.
64+
# SupportedStyles: space, no_space
65+
Style/SpaceAroundEqualsInParameterDefault:
66+
Exclude:
67+
- 'spec/cancan/inherited_resource_spec_BASE_24010.rb'
68+
69+
# Offense count: 4
70+
# Cop supports --auto-correct.
71+
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
72+
# SupportedStyles: space, no_space, compact
73+
Style/SpaceInsideHashLiteralBraces:
74+
Exclude:
75+
- 'spec/cancan/inherited_resource_spec_BASE_24010.rb'
76+
77+
# Offense count: 1
78+
# Cop supports --auto-correct.
79+
Style/TrailingWhitespace:
80+
Exclude:
81+
- 'lib/cancan.rb'
82+
83+
84+
# has a bug
85+
Style/FileName:
86+
Exclude:
87+
- 'Appraisals'
88+
89+
# disagree
90+
Lint/AmbiguousBlockAssociation:
91+
Enabled: false

.travis.yml

+22-16
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,37 @@ language: ruby
22
cache: bundler
33
sudo: false
44
rvm:
5-
- 2.0.0
6-
- 2.1.0
75
- 2.2.0
8-
- 2.2.2
6+
- 2.2.7
7+
- 2.3.4
8+
- 2.4.1
99
- jruby-9.0.5.0
10+
- jruby-9.1.8.0
1011
gemfile:
11-
- gemfiles/activerecord_3.2.gemfile
12-
- gemfiles/activerecord_4.0.gemfile
13-
- gemfiles/activerecord_4.1.gemfile
1412
- gemfiles/activerecord_4.2.gemfile
15-
- gemfiles/activerecord_5.0.gemfile
16-
- gemfiles/mongoid_2.x.gemfile
17-
- gemfiles/sequel_3.x.gemfile
13+
- gemfiles/activerecord_5.0.2.gemfile
14+
- gemfiles/activerecord_5.1.0.gemfile
1815
services:
1916
- mongodb
2017
matrix:
2118
fast_finish: true
2219
exclude:
23-
- rvm: 2.0.0
24-
gemfile: gemfiles/activerecord_5.0.gemfile
25-
- rvm: 2.1.0
26-
gemfile: gemfiles/activerecord_5.0.gemfile
2720
- rvm: 2.2.0
28-
gemfile: gemfiles/activerecord_5.0.gemfile
21+
gemfile: gemfiles/activerecord_5.0.2.gemfile
22+
- rvm: 2.2.0
23+
gemfile: gemfiles/activerecord_5.1.0.gemfile
24+
- rvm: 2.2.7
25+
gemfile: gemfiles/activerecord_5.0.2.gemfile
26+
- rvm: 2.2.7
27+
gemfile: gemfiles/activerecord_5.1.0.gemfile
28+
- rvm: jruby-9.0.5.0
29+
gemfile: gemfiles/activerecord_5.0.2.gemfile
30+
- rvm: jruby-9.1.8.0
31+
gemfile: gemfiles/activerecord_5.0.2.gemfile
2932
- rvm: jruby-9.0.5.0
30-
gemfile: gemfiles/activerecord_5.0.gemfile
33+
gemfile: gemfiles/activerecord_5.1.0.gemfile
34+
- rvm: jruby-9.1.8.0
35+
gemfile: gemfiles/activerecord_5.1.0.gemfile
3136
notifications:
3237
email:
3338
recipients:
@@ -36,4 +41,5 @@ notifications:
3641
3742
on_success: change
3843
on_failure: change
39-
44+
script:
45+
- bundle exec rubocop && bundle exec rake

Appraisals

+25-82
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,48 @@
1-
appraise "activerecord_3.2" do
2-
gem "activerecord", "~> 3.2.0", :require => "active_record"
3-
gem "actionpack", "~> 3.2.0", :require => "action_pack"
1+
appraise 'activerecord_4.2' do
2+
gem 'activerecord', '~> 4.2.0', require: 'active_record'
3+
gem 'activesupport', '~> 4.2.0', require: 'active_support/all'
4+
gem 'actionpack', '~> 4.2.0', require: 'action_pack'
5+
gem 'nokogiri', '~> 1.6.8', require: 'nokogiri' # TODO: fix for ruby 2.0.0
46

57
gemfile.platforms :jruby do
6-
gem "activerecord-jdbcsqlite3-adapter"
7-
gem "jdbc-sqlite3"
8+
gem 'activerecord-jdbcsqlite3-adapter'
9+
gem 'jdbc-sqlite3'
810
end
911

1012
gemfile.platforms :ruby, :mswin, :mingw do
11-
gem "sqlite3"
13+
gem 'sqlite3'
14+
gem 'pg'
1215
end
1316
end
1417

15-
appraise "activerecord_4.0" do
16-
gem "activerecord", "~> 4.0.5", :require => "active_record"
17-
gem "activesupport", "~> 4.0.5", :require => "active_support/all"
18-
gem "actionpack", "~> 4.0.5", :require => "action_pack"
19-
20-
21-
gemfile.platforms :jruby do
22-
gem "activerecord-jdbcsqlite3-adapter"
23-
gem "jdbc-sqlite3"
24-
end
25-
26-
gemfile.platforms :ruby, :mswin, :mingw do
27-
gem "sqlite3"
28-
end
29-
end
30-
31-
appraise "activerecord_4.1" do
32-
gem "activerecord", "~> 4.1.1", :require => "active_record"
33-
gem "activesupport", "~> 4.1.1", :require => "active_support/all"
34-
gem "actionpack", "~> 4.1.1", :require => "action_pack"
35-
36-
gemfile.platforms :jruby do
37-
gem "activerecord-jdbcsqlite3-adapter"
38-
gem "jdbc-sqlite3"
39-
end
40-
41-
gemfile.platforms :ruby, :mswin, :mingw do
42-
gem "sqlite3"
43-
end
44-
end
45-
46-
appraise "activerecord_4.2" do
47-
gem "activerecord", "~> 4.2.0", :require => "active_record"
48-
gem 'activesupport', '~> 4.2.0', :require => 'active_support/all'
49-
gem "actionpack", "~> 4.2.0", :require => "action_pack"
50-
gem "nokogiri", "~> 1.6.8", :require => "nokogiri" # TODO: fix for ruby 2.0.0
18+
appraise 'activerecord_5.0.2' do
19+
gem 'activerecord', '~> 5.0.2', require: 'active_record'
20+
gem 'activesupport', '~> 5.0.2', require: 'active_support/all'
21+
gem 'actionpack', '~> 5.0.2', require: 'action_pack'
5122

5223
gemfile.platforms :jruby do
53-
gem "activerecord-jdbcsqlite3-adapter"
54-
gem "jdbc-sqlite3"
24+
gem 'activerecord-jdbcsqlite3-adapter'
25+
gem 'jdbc-sqlite3'
5526
end
5627

5728
gemfile.platforms :ruby, :mswin, :mingw do
58-
gem "sqlite3"
59-
gem "pg"
60-
end
61-
end
62-
63-
appraise "activerecord_5.0" do
64-
gem "activerecord", "~> 5.0.0.rc1", :require => "active_record"
65-
gem 'activesupport', '~> 5.0.0.rc1', :require => 'active_support/all'
66-
gem "actionpack", "~> 5.0.0.rc1", :require => "action_pack"
67-
68-
gemfile.platforms :jruby do
69-
gem "activerecord-jdbcsqlite3-adapter"
70-
gem "jdbc-sqlite3"
71-
end
72-
73-
gemfile.platforms :ruby, :mswin, :mingw do
74-
gem "sqlite3"
75-
gem "pg"
76-
end
77-
end
78-
79-
appraise "mongoid_2.x" do
80-
gem "activesupport", "~> 3.0", :require => "active_support/all"
81-
gem "actionpack", "~> 3.0", :require => "action_pack"
82-
gem "mongoid", "~> 2.0.0"
83-
84-
gemfile.platforms :ruby, :mswin, :mingw do
85-
gem "bson_ext", "~> 1.1"
86-
end
87-
88-
gemfile.platforms :jruby do
89-
gem "mongo", "~> 1.9.2"
29+
gem 'sqlite3'
30+
gem 'pg'
9031
end
9132
end
9233

93-
appraise "sequel_3.x" do
94-
gem "sequel", "~> 3.48.0"
95-
gem "activesupport", "~> 3.0", :require => "active_support/all"
96-
gem "actionpack", "~> 3.0", :require => "action_pack"
34+
appraise 'activerecord_5.1.0' do
35+
gem 'activerecord', '~> 5.1.0', require: 'active_record'
36+
gem 'activesupport', '~> 5.1.0', require: 'active_support/all'
37+
gem 'actionpack', '~> 5.1.0', require: 'action_pack'
9738

9839
gemfile.platforms :jruby do
99-
gem "jdbc-sqlite3"
40+
gem 'activerecord-jdbcsqlite3-adapter'
41+
gem 'jdbc-sqlite3'
10042
end
10143

10244
gemfile.platforms :ruby, :mswin, :mingw do
103-
gem "sqlite3"
45+
gem 'sqlite3'
46+
gem 'pg'
10447
end
10548
end

CHANGELOG.rdoc

+13
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,23 @@ Develop
22

33
Unreleased
44

5+
2.0.0 (TBD)
6+
7+
* Drop support for Rails < 4.2 (oliverklee)
8+
* Drop support for ruby < 2.2 (coorasse)
9+
* Drop support for InheritedResource (coorasse)
10+
* Drop support for Sequel (coorasse)
11+
* Drop support for Mongoid (coorasse)
12+
* Add ability to rspec matcher to take array of abilities (gingray)
13+
* Increase Performance (timraymond) (https://github.com/CanCanCommunity/cancancan/pull/204)
14+
* Removed controller methods: skip_authorization, unauthorized! (coorasse)
15+
* Removed options: nested, name, resource (coorasse)
16+
517
1.17.0 (March 26th, 2017)
618

719
* Improve performance for the Mongoid Adapter
820

21+
922
1.16.0 (February 2nd, 2017)
1023

1124
* Introduce rubocop and fixes most of the issues

0 commit comments

Comments
 (0)