Skip to content

Commit

Permalink
Isolate extensions within specific Gemfile (#2430)
Browse files Browse the repository at this point in the history
* Extensions in separate Gemfile

- hashie
- grape-entity
- dry-validation
  • Loading branch information
ericproulx committed Apr 15, 2024
1 parent b43cfde commit 9e68e46
Show file tree
Hide file tree
Showing 33 changed files with 1,115 additions and 981 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ jobs:
gemfile: gemfiles/rack_3_0.gemfile
specs: 'spec/integration/rack_3_0'
- ruby: '3.3'
gemfile: gemfiles/no_dry_validation.gemfile
specs: 'spec/integration/no_dry_validation'
gemfile: gemfiles/grape_entity.gemfile
specs: 'spec/integration/grape_entity'
- ruby: '3.3'
gemfile: gemfiles/hashie.gemfile
specs: 'spec/integration/hashie'
- ruby: '3.3'
gemfile: gemfiles/dry_validation.gemfile
specs: 'spec/integration/dry_validation'
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
Expand Down
11 changes: 2 additions & 9 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 5000`
# on 2024-04-01 12:18:08 UTC using RuboCop version 1.59.0.
# on 2024-04-15 16:22:26 UTC using RuboCop version 1.59.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
Expand Down Expand Up @@ -165,22 +165,15 @@ RSpec/MissingExampleGroupArgument:
Exclude:
- 'spec/grape/middleware/exception_spec.rb'

# Offense count: 18
# Offense count: 17
# Configuration parameters: AllowedPatterns.
# AllowedPatterns: ^expect_, ^assert_
RSpec/NoExpectationExample:
Exclude:
- 'spec/grape/api_remount_spec.rb'
- 'spec/grape/api_spec.rb'
- 'spec/grape/entity_spec.rb'
- 'spec/grape/validations_spec.rb'

# Offense count: 6
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/Rails/HaveHttpStatus:
Exclude:
- 'spec/grape/api_spec.rb'

# Offense count: 12
RSpec/RepeatedDescription:
Exclude:
Expand Down
2 changes: 1 addition & 1 deletion Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ appraise 'rack_3_0' do
gem 'rack', '~> 3.0.0'
end

appraise 'no_dry_validation' do
appraise 'dry_validation' do
group :development, :test do
remove_gem 'dry-validation'
end
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* [#2427](https://github.com/ruby-grape/grape/pull/2427): Use `rack-contrib` jsonp instead of rack-jsonp - [@ericproulx](https://github.com/ericproulx).
* [#2363](https://github.com/ruby-grape/grape/pull/2363): Replace autoload by zeitwerk - [@ericproulx](https://github.com/ericproulx).
* [#2425](https://github.com/ruby-grape/grape/pull/2425): Replace `{}` with `Rack::Header` or `Rack::Utils::HeaderHash` - [@dhruvCW](https://github.com/dhruvCW).
* [#2430](https://github.com/ruby-grape/grape/pull/2430): Isolate extensions within specific gemfile - [@ericproulx](https://github.com/ericproulx).
* Your contribution here.

#### Fixes
Expand Down
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ gemspec

group :development, :test do
gem 'bundler'
gem 'dry-validation'
gem 'hashie'
gem 'rake'
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
Expand All @@ -26,7 +24,6 @@ group :development do
end

group :test do
gem 'grape-entity', '~> 0.6', require: false
gem 'rack-contrib', require: false
gem 'rack-test', '< 2.1'
gem 'rspec', '< 4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

source 'https://rubygems.org'

gem 'dry-validation'

group :development, :test do
gem 'bundler'
gem 'hashie'
gem 'rake'
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
Expand All @@ -23,7 +24,6 @@ group :development do
end

group :test do
gem 'grape-entity', '~> 0.6', require: false
gem 'rack-contrib', require: false
gem 'rack-test', '< 2.1'
gem 'rspec', '< 4'
Expand Down
40 changes: 40 additions & 0 deletions gemfiles/grape_entity.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source 'https://rubygems.org'

gem 'grape-entity'

group :development, :test do
gem 'bundler'
gem 'rake'
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
gem 'rubocop-rspec', '2.25.0', require: false
end

group :development do
gem 'appraisal'
gem 'benchmark-ips'
gem 'benchmark-memory'
gem 'guard'
gem 'guard-rspec'
gem 'guard-rubocop'
end

group :test do
gem 'rack-contrib', require: false
gem 'rack-test', '< 2.1'
gem 'rspec', '< 4'
gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'simplecov', '~> 0.21.2'
gem 'simplecov-lcov', '~> 0.8.0'
gem 'test-prof', require: false
end

platforms :jruby do
gem 'racc'
end

gemspec path: '../'
40 changes: 40 additions & 0 deletions gemfiles/hashie.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source 'https://rubygems.org'

gem 'hashie'

group :development, :test do
gem 'bundler'
gem 'rake'
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
gem 'rubocop-rspec', '2.25.0', require: false
end

group :development do
gem 'appraisal'
gem 'benchmark-ips'
gem 'benchmark-memory'
gem 'guard'
gem 'guard-rspec'
gem 'guard-rubocop'
end

group :test do
gem 'rack-contrib', require: false
gem 'rack-test', '< 2.1'
gem 'rspec', '< 4'
gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'simplecov', '~> 0.21.2'
gem 'simplecov-lcov', '~> 0.8.0'
gem 'test-prof', require: false
end

platforms :jruby do
gem 'racc'
end

gemspec path: '../'
3 changes: 0 additions & 3 deletions gemfiles/multi_json.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ gem 'multi_json', require: 'multi_json'

group :development, :test do
gem 'bundler'
gem 'dry-validation'
gem 'hashie'
gem 'rake'
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
Expand All @@ -26,7 +24,6 @@ group :development do
end

group :test do
gem 'grape-entity', '~> 0.6', require: false
gem 'rack-contrib', require: false
gem 'rack-test', '< 2.1'
gem 'rspec', '< 4'
Expand Down
3 changes: 0 additions & 3 deletions gemfiles/multi_xml.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ gem 'multi_xml', require: 'multi_xml'

group :development, :test do
gem 'bundler'
gem 'dry-validation'
gem 'hashie'
gem 'rake'
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
Expand All @@ -26,7 +24,6 @@ group :development do
end

group :test do
gem 'grape-entity', '~> 0.6', require: false
gem 'rack-contrib', require: false
gem 'rack-test', '< 2.1'
gem 'rspec', '< 4'
Expand Down
3 changes: 0 additions & 3 deletions gemfiles/rack_2_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ gem 'rack', '~> 2.0'

group :development, :test do
gem 'bundler'
gem 'dry-validation'
gem 'hashie'
gem 'rake'
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
Expand All @@ -26,7 +24,6 @@ group :development do
end

group :test do
gem 'grape-entity', '~> 0.6', require: false
gem 'rack-contrib', require: false
gem 'rack-test', '< 2.1'
gem 'rspec', '< 4'
Expand Down
3 changes: 0 additions & 3 deletions gemfiles/rack_3_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ gem 'rack', '~> 3.0.0'

group :development, :test do
gem 'bundler'
gem 'dry-validation'
gem 'hashie'
gem 'rake'
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
Expand All @@ -26,7 +24,6 @@ group :development do
end

group :test do
gem 'grape-entity', '~> 0.6', require: false
gem 'rack-contrib', require: false
gem 'rack-test', '< 2.1'
gem 'rspec', '< 4'
Expand Down
3 changes: 0 additions & 3 deletions gemfiles/rack_edge.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ gem 'rack', github: 'rack/rack'

group :development, :test do
gem 'bundler'
gem 'dry-validation'
gem 'hashie'
gem 'rake'
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
Expand All @@ -26,7 +24,6 @@ group :development do
end

group :test do
gem 'grape-entity', '~> 0.6', require: false
gem 'rack-contrib', require: false
gem 'rack-test', '< 2.1'
gem 'rspec', '< 4'
Expand Down
3 changes: 0 additions & 3 deletions gemfiles/rails_6_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ gem 'rails', '~> 6.0.0'

group :development, :test do
gem 'bundler'
gem 'dry-validation'
gem 'hashie'
gem 'rake'
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
Expand All @@ -26,7 +24,6 @@ group :development do
end

group :test do
gem 'grape-entity', '~> 0.6', require: false
gem 'rack-contrib', require: false
gem 'rack-test', '< 2.1'
gem 'rspec', '< 4'
Expand Down
3 changes: 0 additions & 3 deletions gemfiles/rails_6_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ gem 'rails', '~> 6.1'

group :development, :test do
gem 'bundler'
gem 'dry-validation'
gem 'hashie'
gem 'rake'
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
Expand All @@ -26,7 +24,6 @@ group :development do
end

group :test do
gem 'grape-entity', '~> 0.6', require: false
gem 'rack-contrib', require: false
gem 'rack-test', '< 2.1'
gem 'rspec', '< 4'
Expand Down
3 changes: 0 additions & 3 deletions gemfiles/rails_7_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ gem 'rails', '~> 7.0.0'

group :development, :test do
gem 'bundler'
gem 'dry-validation'
gem 'hashie'
gem 'rake'
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
Expand All @@ -26,7 +24,6 @@ group :development do
end

group :test do
gem 'grape-entity', '~> 0.6', require: false
gem 'rack-contrib', require: false
gem 'rack-test', '< 2.1'
gem 'rspec', '< 4'
Expand Down
3 changes: 0 additions & 3 deletions gemfiles/rails_7_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ gem 'rails', '~> 7.1.0'

group :development, :test do
gem 'bundler'
gem 'dry-validation'
gem 'hashie'
gem 'rake'
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
Expand All @@ -26,7 +24,6 @@ group :development do
end

group :test do
gem 'grape-entity', '~> 0.6', require: false
gem 'rack-contrib', require: false
gem 'rack-test', '< 2.1'
gem 'rspec', '< 4'
Expand Down
3 changes: 0 additions & 3 deletions gemfiles/rails_edge.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ gem 'rails', github: 'rails/rails'

group :development, :test do
gem 'bundler'
gem 'dry-validation'
gem 'hashie'
gem 'rake'
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
Expand All @@ -26,7 +24,6 @@ group :development do
end

group :test do
gem 'grape-entity', '~> 0.6', require: false
gem 'rack-contrib', require: false
gem 'rack-test', '< 2.1'
gem 'rspec', '< 4'
Expand Down
2 changes: 0 additions & 2 deletions spec/grape/api/documentation_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe Grape::API do
subject { Class.new(described_class) }

Expand Down
Loading

0 comments on commit 9e68e46

Please sign in to comment.