From 5bb023edaba25867642001e46d42cf8ceb6bf772 Mon Sep 17 00:00:00 2001 From: Michael Scrivo Date: Mon, 13 Nov 2023 11:04:22 -0500 Subject: [PATCH] Update to work with Grape 2.0 --- .github/workflows/ci.yml | 52 ++++++++++++++++++++-------------------- Gemfile | 5 ++-- grape-swagger.gemspec | 2 +- 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cda30b2..7cb6d299 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,11 +23,11 @@ jobs: - name: Run rubocop run: bundle exec rubocop --parallel --format progress - grape-17: + grape-18: runs-on: ubuntu-latest needs: ['rubocop'] env: - GRAPE_VERSION: '1.7.1' + GRAPE_VERSION: '1.8.0' strategy: matrix: ruby-version: ['3.1', '3.2', 'head'] @@ -55,37 +55,37 @@ jobs: bundle update bundle exec rspec - grape-18: + grape-20: runs-on: ubuntu-latest needs: ['rubocop'] env: - GRAPE_VERSION: '1.8.0' + GRAPE_VERSION: '2.0.0' strategy: matrix: ruby-version: ['3.1', '3.2', 'head'] steps: - - name: Check out branch - uses: actions/checkout@v4 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby-version }} - - name: Run rspec wo model parser - run: | - bundle update - bundle exec rspec - - name: Run rspec w entity parser - env: - MODEL_PARSER: grape-swagger-entity - run: | - bundle update - bundle exec rspec - - name: Run rspec w representable parser - env: - MODEL_PARSER: grape-swagger-representable - run: | - bundle update - bundle exec rspec + - name: Check out branch + uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + - name: Run rspec wo model parser + run: | + bundle update + bundle exec rspec + - name: Run rspec w entity parser + env: + MODEL_PARSER: grape-swagger-entity + run: | + bundle update + bundle exec rspec + - name: Run rspec w representable parser + env: + MODEL_PARSER: grape-swagger-representable + run: | + bundle update + bundle exec rspec grape-HEAD: runs-on: ubuntu-latest diff --git a/Gemfile b/Gemfile index 9ea8fb76..51abac3d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,10 @@ # frozen_string_literal: true -source 'http://rubygems.org' +source 'https://rubygems.org' gemspec -gem 'grape', case version = ENV.fetch('GRAPE_VERSION', '~> 1.7') +gem 'grape', case version = ENV.fetch('GRAPE_VERSION', '~> 1.8') when 'HEAD' { git: 'https://github.com/ruby-grape/grape' } else @@ -34,7 +34,6 @@ end group :test do gem 'coveralls_reborn', require: false - gem 'ruby-grape-danger', '~> 0.2.0', require: false gem 'simplecov', require: false end diff --git a/grape-swagger.gemspec b/grape-swagger.gemspec index 84cd12af..82aa325e 100644 --- a/grape-swagger.gemspec +++ b/grape-swagger.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |s| s.metadata['rubygems_mfa_required'] = 'true' s.required_ruby_version = '>= 2.7' - s.add_runtime_dependency 'grape', '~> 1.3' + s.add_runtime_dependency 'grape', ['>= 1.3.0', '< 3.0.0'] s.add_runtime_dependency 'rack-test', '~> 2' s.files = Dir['lib/**/*', '*.md', 'LICENSE.txt', 'grape-swagger.gemspec']