Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
coorasse committed May 18, 2017
2 parents e633592 + da997d5 commit 8a85c0d
Show file tree
Hide file tree
Showing 38 changed files with 283 additions and 987 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,15 @@ Metrics/ModuleLength:
- 'lib/cancan/ability.rb'
- 'lib/cancan/model_adapters/active_record_adapter.rb'

Metrics/BlockLength:
Exclude:
- 'lib/cancan/matchers.rb'
- '**/*_spec.rb'

AllCops:
TargetRubyVersion: 2.0
Exclude:
- 'gemfiles/vendor/bundle/**/*'
- 'Appraisals'

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

# Offense count: 14
# Offense count: 12
Metrics/AbcSize:
Max: 25
Max: 21

# Offense count: 3
# Configuration parameters: CountComments.
Metrics/BlockLength:
Max: 58

# Offense count: 5
# Offense count: 4
Metrics/CyclomaticComplexity:
Max: 9

# Offense count: 14
# Offense count: 13
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 21


Metrics/BlockLength:
Max: 28
Exclude:
- "**/*_spec.rb"

# Offense count: 7
# Offense count: 4
Metrics/PerceivedComplexity:
Max: 11
Max: 10

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

# Offense count: 4
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts.
Style/FileName:
Exclude:
- 'spec/cancan/inherited_resource_spec_BACKUP_24010.rb'
- 'spec/cancan/inherited_resource_spec_BASE_24010.rb'
- 'spec/cancan/inherited_resource_spec_LOCAL_24010.rb'
- 'spec/cancan/inherited_resource_spec_REMOTE_24010.rb'

# TODO: fixing this would change the APIs
# Offense count: 2
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
# NamePrefix: is_, has_, have_
Expand All @@ -46,3 +57,35 @@ Style/PredicateName:
Exclude:
- 'spec/**/*'
- 'lib/cancan/ability.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: space, no_space
Style/SpaceAroundEqualsInParameterDefault:
Exclude:
- 'spec/cancan/inherited_resource_spec_BASE_24010.rb'

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
# SupportedStyles: space, no_space, compact
Style/SpaceInsideHashLiteralBraces:
Exclude:
- 'spec/cancan/inherited_resource_spec_BASE_24010.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/TrailingWhitespace:
Exclude:
- 'lib/cancan.rb'


# has a bug
Style/FileName:
Exclude:
- 'Appraisals'

# disagree
Lint/AmbiguousBlockAssociation:
Enabled: false
38 changes: 22 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,37 @@ language: ruby
cache: bundler
sudo: false
rvm:
- 2.0.0
- 2.1.0
- 2.2.0
- 2.2.2
- 2.2.7
- 2.3.4
- 2.4.1
- jruby-9.0.5.0
- jruby-9.1.8.0
gemfile:
- gemfiles/activerecord_3.2.gemfile
- gemfiles/activerecord_4.0.gemfile
- gemfiles/activerecord_4.1.gemfile
- gemfiles/activerecord_4.2.gemfile
- gemfiles/activerecord_5.0.gemfile
- gemfiles/mongoid_2.x.gemfile
- gemfiles/sequel_3.x.gemfile
- gemfiles/activerecord_5.0.2.gemfile
- gemfiles/activerecord_5.1.0.gemfile
services:
- mongodb
matrix:
fast_finish: true
exclude:
- rvm: 2.0.0
gemfile: gemfiles/activerecord_5.0.gemfile
- rvm: 2.1.0
gemfile: gemfiles/activerecord_5.0.gemfile
- rvm: 2.2.0
gemfile: gemfiles/activerecord_5.0.gemfile
gemfile: gemfiles/activerecord_5.0.2.gemfile
- rvm: 2.2.0
gemfile: gemfiles/activerecord_5.1.0.gemfile
- rvm: 2.2.7
gemfile: gemfiles/activerecord_5.0.2.gemfile
- rvm: 2.2.7
gemfile: gemfiles/activerecord_5.1.0.gemfile
- rvm: jruby-9.0.5.0
gemfile: gemfiles/activerecord_5.0.2.gemfile
- rvm: jruby-9.1.8.0
gemfile: gemfiles/activerecord_5.0.2.gemfile
- rvm: jruby-9.0.5.0
gemfile: gemfiles/activerecord_5.0.gemfile
gemfile: gemfiles/activerecord_5.1.0.gemfile
- rvm: jruby-9.1.8.0
gemfile: gemfiles/activerecord_5.1.0.gemfile
notifications:
email:
recipients:
Expand All @@ -36,4 +41,5 @@ notifications:
- zora.fuchs@renuo.ch
on_success: change
on_failure: change

script:
- bundle exec rubocop && bundle exec rake
107 changes: 25 additions & 82 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,105 +1,48 @@
appraise "activerecord_3.2" do
gem "activerecord", "~> 3.2.0", :require => "active_record"
gem "actionpack", "~> 3.2.0", :require => "action_pack"
appraise 'activerecord_4.2' do
gem 'activerecord', '~> 4.2.0', require: 'active_record'
gem 'activesupport', '~> 4.2.0', require: 'active_support/all'
gem 'actionpack', '~> 4.2.0', require: 'action_pack'
gem 'nokogiri', '~> 1.6.8', require: 'nokogiri' # TODO: fix for ruby 2.0.0

gemfile.platforms :jruby do
gem "activerecord-jdbcsqlite3-adapter"
gem "jdbc-sqlite3"
gem 'activerecord-jdbcsqlite3-adapter'
gem 'jdbc-sqlite3'
end

gemfile.platforms :ruby, :mswin, :mingw do
gem "sqlite3"
gem 'sqlite3'
gem 'pg'
end
end

appraise "activerecord_4.0" do
gem "activerecord", "~> 4.0.5", :require => "active_record"
gem "activesupport", "~> 4.0.5", :require => "active_support/all"
gem "actionpack", "~> 4.0.5", :require => "action_pack"


gemfile.platforms :jruby do
gem "activerecord-jdbcsqlite3-adapter"
gem "jdbc-sqlite3"
end

gemfile.platforms :ruby, :mswin, :mingw do
gem "sqlite3"
end
end

appraise "activerecord_4.1" do
gem "activerecord", "~> 4.1.1", :require => "active_record"
gem "activesupport", "~> 4.1.1", :require => "active_support/all"
gem "actionpack", "~> 4.1.1", :require => "action_pack"

gemfile.platforms :jruby do
gem "activerecord-jdbcsqlite3-adapter"
gem "jdbc-sqlite3"
end

gemfile.platforms :ruby, :mswin, :mingw do
gem "sqlite3"
end
end

appraise "activerecord_4.2" do
gem "activerecord", "~> 4.2.0", :require => "active_record"
gem 'activesupport', '~> 4.2.0', :require => 'active_support/all'
gem "actionpack", "~> 4.2.0", :require => "action_pack"
gem "nokogiri", "~> 1.6.8", :require => "nokogiri" # TODO: fix for ruby 2.0.0
appraise 'activerecord_5.0.2' do
gem 'activerecord', '~> 5.0.2', require: 'active_record'
gem 'activesupport', '~> 5.0.2', require: 'active_support/all'
gem 'actionpack', '~> 5.0.2', require: 'action_pack'

gemfile.platforms :jruby do
gem "activerecord-jdbcsqlite3-adapter"
gem "jdbc-sqlite3"
gem 'activerecord-jdbcsqlite3-adapter'
gem 'jdbc-sqlite3'
end

gemfile.platforms :ruby, :mswin, :mingw do
gem "sqlite3"
gem "pg"
end
end

appraise "activerecord_5.0" do
gem "activerecord", "~> 5.0.0.rc1", :require => "active_record"
gem 'activesupport', '~> 5.0.0.rc1', :require => 'active_support/all'
gem "actionpack", "~> 5.0.0.rc1", :require => "action_pack"

gemfile.platforms :jruby do
gem "activerecord-jdbcsqlite3-adapter"
gem "jdbc-sqlite3"
end

gemfile.platforms :ruby, :mswin, :mingw do
gem "sqlite3"
gem "pg"
end
end

appraise "mongoid_2.x" do
gem "activesupport", "~> 3.0", :require => "active_support/all"
gem "actionpack", "~> 3.0", :require => "action_pack"
gem "mongoid", "~> 2.0.0"

gemfile.platforms :ruby, :mswin, :mingw do
gem "bson_ext", "~> 1.1"
end

gemfile.platforms :jruby do
gem "mongo", "~> 1.9.2"
gem 'sqlite3'
gem 'pg'
end
end

appraise "sequel_3.x" do
gem "sequel", "~> 3.48.0"
gem "activesupport", "~> 3.0", :require => "active_support/all"
gem "actionpack", "~> 3.0", :require => "action_pack"
appraise 'activerecord_5.1.0' do
gem 'activerecord', '~> 5.1.0', require: 'active_record'
gem 'activesupport', '~> 5.1.0', require: 'active_support/all'
gem 'actionpack', '~> 5.1.0', require: 'action_pack'

gemfile.platforms :jruby do
gem "jdbc-sqlite3"
gem 'activerecord-jdbcsqlite3-adapter'
gem 'jdbc-sqlite3'
end

gemfile.platforms :ruby, :mswin, :mingw do
gem "sqlite3"
gem 'sqlite3'
gem 'pg'
end
end
13 changes: 13 additions & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,23 @@ Develop

Unreleased

2.0.0 (TBD)

* Drop support for Rails < 4.2 (oliverklee)
* Drop support for ruby < 2.2 (coorasse)
* Drop support for InheritedResource (coorasse)
* Drop support for Sequel (coorasse)
* Drop support for Mongoid (coorasse)
* Add ability to rspec matcher to take array of abilities (gingray)
* Increase Performance (timraymond) (https://github.com/CanCanCommunity/cancancan/pull/204)
* Removed controller methods: skip_authorization, unauthorized! (coorasse)
* Removed options: nested, name, resource (coorasse)

1.17.0 (March 26th, 2017)

* Improve performance for the Mongoid Adapter


1.16.0 (February 2nd, 2017)

* Introduce rubocop and fixes most of the issues
Expand Down

0 comments on commit 8a85c0d

Please sign in to comment.