Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Pundit v2 #104

Merged
merged 3 commits into from
Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
/spec/dummy/tmp/
*.orig
.ruby-version
/gemfiles/*.gemfile.lock
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ AllCops:
Style/FileName:
Exclude:
- lib/jsonapi-authorization.rb
- Appraisals

Metrics/LineLength:
Enabled: true
Expand Down
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
language: ruby
env:
- JSONAPI_RESOURCES_VERSION=0.9 RAILS_VERSION=4.2.0
- JSONAPI_RESOURCES_VERSION=0.9 RAILS_VERSION=5.0.0
- JSONAPI_RESOURCES_VERSION=0.9 RAILS_VERSION=5.1.0
- JSONAPI_RESOURCES_VERSION=0.9 RAILS_VERSION=5.2.0
install:
- bundle install
rvm:
- 2.3
gemfile:
- gemfiles/rails_4_2_pundit_1.gemfile
- gemfiles/rails_5_0_pundit_1.gemfile
- gemfiles/rails_5_1_pundit_1.gemfile
- gemfiles/rails_5_2_pundit_1.gemfile
- gemfiles/rails_4_2_pundit_2.gemfile
- gemfiles/rails_5_0_pundit_2.gemfile
- gemfiles/rails_5_1_pundit_2.gemfile
- gemfiles/rails_5_2_pundit_2.gemfile
before_install: gem install bundler -v 1.16.2
notifications:
email: false
Expand Down
47 changes: 47 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
appraise 'rails-4-2 pundit-1' do
gem 'rails', '4.2.0'
gem 'jsonapi-resources', '0.9'
gem 'pundit', '~> 1.0'
end

appraise 'rails-5-0 pundit-1' do
gem 'rails', '5.0.0'
gem 'jsonapi-resources', '0.9'
gem 'pundit', '~> 1.0'
end

appraise 'rails-5-1 pundit-1' do
gem "rails", "5.1.0"
gem 'jsonapi-resources', '0.9'
gem 'pundit', '~> 1.0'
end

appraise 'rails-5-2 pundit-1' do
gem 'rails', '5.2.0'
gem 'jsonapi-resources', '0.9'
gem 'pundit', '~> 1.0'
end

appraise 'rails-4-2 pundit-2' do
gem 'rails', '4.2.0'
gem 'jsonapi-resources', '0.9'
gem 'pundit', '~> 2.0'
end

appraise 'rails-5-0 pundit-2' do
gem 'rails', '5.0.0'
gem 'jsonapi-resources', '0.9'
gem 'pundit', '~> 2.0'
end

appraise 'rails-5-1 pundit-2' do
gem 'rails', '5.1.0'
gem 'jsonapi-resources', '0.9'
gem 'pundit', '~> 2.0'
end

appraise 'rails-5-2 pundit-2' do
gem 'rails', '5.2.0'
gem 'jsonapi-resources', '0.9'
gem 'pundit', '~> 2.0'
end
20 changes: 0 additions & 20 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
source 'https://rubygems.org'

gemspec

rails_version = ENV['RAILS_VERSION'] || 'default'
jsonapi_resources_version = ENV['JSONAPI_RESOURCES_VERSION'] || 'default'

case rails_version
when 'master'
gem 'rails', git: 'https://github.com/rails/rails.git'
gem 'arel', git: 'https://github.com/rails/arel.git'
when 'default'
gem 'rails', '>= 4.2'
else
gem 'rails', "~> #{rails_version}"
end

case jsonapi_resources_version
when 'default'
gem 'jsonapi-resources', '0.9'
else
gem 'jsonapi-resources', jsonapi_resources_version
end
9 changes: 9 additions & 0 deletions gemfiles/rails_4_2_pundit_1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "4.2.0"
gem "jsonapi-resources", "0.9"
gem "pundit", "~> 1.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/rails_4_2_pundit_2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "4.2.0"
gem "jsonapi-resources", "0.9"
gem "pundit", "~> 2.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/rails_5_0_pundit_1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "5.0.0"
gem "jsonapi-resources", "0.9"
gem "pundit", "~> 1.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/rails_5_0_pundit_2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "5.0.0"
gem "jsonapi-resources", "0.9"
gem "pundit", "~> 2.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/rails_5_1_pundit_1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "5.1.0"
gem "jsonapi-resources", "0.9"
gem "pundit", "~> 1.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/rails_5_1_pundit_2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "5.1.0"
gem "jsonapi-resources", "0.9"
gem "pundit", "~> 2.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/rails_5_2_pundit_1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "5.2.0"
gem "jsonapi-resources", "0.9"
gem "pundit", "~> 1.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/rails_5_2_pundit_2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "5.2.0"
gem "jsonapi-resources", "0.9"
gem "pundit", "~> 2.0"

gemspec path: "../"
7 changes: 4 additions & 3 deletions jsonapi-authorization.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_dependency "jsonapi-resources", "~> 0.9"
spec.add_dependency "pundit", "~> 1.0"
spec.add_dependency "pundit", ">= 1.0.0", "< 3.0.0"

spec.add_development_dependency "appraisal"
spec.add_development_dependency "bundler", "~> 1.11"
spec.add_development_dependency "rake", "~> 12.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rspec-rails", "~> 3.7"
spec.add_development_dependency "rspec", "~> 3.8"
spec.add_development_dependency "rspec-rails", "~> 3.8"
spec.add_development_dependency "pry"
spec.add_development_dependency "pry-byebug"
spec.add_development_dependency "pry-doc"
Expand Down