From 3ec67f997cc8a724400291dd282471a12484fdbc Mon Sep 17 00:00:00 2001 From: Eric Proulx Date: Sun, 25 Jan 2026 17:21:57 +0100 Subject: [PATCH] Update minimum Ruby version to 3.2 - Require Ruby >= 3.2 instead of >= 3.1 - Update ActiveSupport dependency to >= 7.2 - Update RuboCop to 1.84.0 and rubocop-rspec to 3.9.0 - Remove Ruby 3.1 from CI test matrix - Clean up code: remove unused require, update syntax --- .github/workflows/edge.yml | 5 +---- .github/workflows/test.yml | 8 +------- .rubocop.yml | 2 +- .rubocop_todo.yml | 5 ++--- CHANGELOG.md | 9 ++------- Gemfile | 4 ++-- README.md | 2 +- gemfiles/rails_7_1.gemfile | 6 ------ grape.gemspec | 4 ++-- lib/grape.rb | 1 - lib/grape/dsl/routing.rb | 4 ++-- 11 files changed, 14 insertions(+), 36 deletions(-) delete mode 100644 gemfiles/rails_7_1.gemfile diff --git a/.github/workflows/edge.yml b/.github/workflows/edge.yml index d02615971..09f463e07 100644 --- a/.github/workflows/edge.yml +++ b/.github/workflows/edge.yml @@ -6,11 +6,8 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.1', '3.2', '3.3', '3.4', '4.0', ruby-head, truffleruby-head, jruby-head] + ruby: ['3.2', '3.3', '3.4', '4.0', ruby-head, truffleruby-head, jruby-head] gemfile: [rails_edge, rack_edge] - exclude: - - ruby: '3.1' - gemfile: rails_edge runs-on: ubuntu-latest continue-on-error: true env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2cf9f2d84..bbd5a2c5b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,14 +23,13 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.1', '3.2', '3.3', '3.4', '4.0'] + ruby: ['3.2', '3.3', '3.4', '4.0'] gemfile: - Gemfile - gemfiles/rack_2_2.gemfile - gemfiles/rack_3_0.gemfile - gemfiles/rack_3_1.gemfile - gemfiles/rack_3_2.gemfile - - gemfiles/rails_7_1.gemfile - gemfiles/rails_7_2.gemfile - gemfiles/rails_8_0.gemfile - gemfiles/rails_8_1.gemfile @@ -51,11 +50,6 @@ jobs: - ruby: '4.0' gemfile: gemfiles/multi_xml.gemfile specs: 'spec/integration/multi_xml' - exclude: - - ruby: '3.1' - gemfile: gemfiles/rails_8_0.gemfile - - ruby: '3.1' - gemfile: gemfiles/rails_8_1.gemfile runs-on: ubuntu-latest env: BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }} diff --git a/.rubocop.yml b/.rubocop.yml index 4ec2046a7..3e407d0bb 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,6 @@ AllCops: NewCops: enable - TargetRubyVersion: 3.1 + TargetRubyVersion: 3.2 SuggestExtensions: false Exclude: - vendor/**/* diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 5b7a0538c..1cdd82025 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2025-12-20 20:56:19 UTC using RuboCop version 1.81.7. +# on 2026-01-31 18:13:50 UTC using RuboCop version 1.84.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 @@ -39,12 +39,11 @@ RSpec/ExampleWording: - 'spec/grape/integration/global_namespace_function_spec.rb' - 'spec/grape/validations_spec.rb' -# Offense count: 6 +# Offense count: 2 # This cop supports safe autocorrection (--autocorrect). RSpec/ExpectActual: Exclude: - '**/spec/routing/**/*' - - 'spec/grape/endpoint/declared_spec.rb' - 'spec/grape/middleware/exception_spec.rb' # Offense count: 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index e729a3dd3..6dd238c08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,18 +1,13 @@ ### 3.2.0 (Next) -#### Fixes - -* Your contribution here - #### Features -* Your contribution here - -### 3.1.1 (2026-01-31) +* Your contribution here. #### Fixes * [#2655](https://github.com/ruby-grape/grape/pull/2655): Fix `before_each` method to handle `nil` parameter correctly - [@ericproulx](https://github.com/ericproulx). +* Your contribution here. ### 3.1.0 (2026-01-25) diff --git a/Gemfile b/Gemfile index d7e491d15..abf49f83f 100644 --- a/Gemfile +++ b/Gemfile @@ -8,9 +8,9 @@ group :development, :test do gem 'builder', require: false gem 'bundler' gem 'rake' - gem 'rubocop', '1.81.7', require: false + gem 'rubocop', '1.84.0', require: false gem 'rubocop-performance', '1.26.1', require: false - gem 'rubocop-rspec', '3.8.0', require: false + gem 'rubocop-rspec', '3.9.0', require: false end group :development do diff --git a/README.md b/README.md index d05b6275d..14c0173ab 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ The maintainers of Grape are working with Tidelift to deliver commercial support ## Installation -Ruby 3.1 or newer is required. +Ruby 3.2 or newer is required. Grape is available as a gem, to install it run: diff --git a/gemfiles/rails_7_1.gemfile b/gemfiles/rails_7_1.gemfile deleted file mode 100644 index 81358706c..000000000 --- a/gemfiles/rails_7_1.gemfile +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -eval_gemfile '../Gemfile' - -gem 'rails', '~> 7.1.0' -gem 'tzinfo-data', require: false diff --git a/grape.gemspec b/grape.gemspec index 60c5795c9..71568d94a 100644 --- a/grape.gemspec +++ b/grape.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |s| 'rubygems_mfa_required' => 'true' } - s.add_dependency 'activesupport', '>= 7.1' + s.add_dependency 'activesupport', '>= 7.2' s.add_dependency 'dry-configurable' s.add_dependency 'dry-types', '>= 1.1' s.add_dependency 'mustermann-grape', '~> 1.1.0' @@ -29,5 +29,5 @@ Gem::Specification.new do |s| s.files = Dir['lib/**/*', 'CHANGELOG.md', 'CONTRIBUTING.md', 'README.md', 'grape.png', 'UPGRADING.md', 'LICENSE', 'grape.gemspec'] s.require_paths = ['lib'] - s.required_ruby_version = '>= 3.1' + s.required_ruby_version = '>= 3.2' end diff --git a/lib/grape.rb b/lib/grape.rb index b36e5c40b..fc9f47cca 100644 --- a/lib/grape.rb +++ b/lib/grape.rb @@ -33,7 +33,6 @@ require 'rack/auth/basic' require 'rack/builder' require 'rack/head' -require 'set' require 'singleton' require 'zeitwerk' diff --git a/lib/grape/dsl/routing.rb b/lib/grape/dsl/routing.rb index 3698fb2db..ee8f9f5d9 100644 --- a/lib/grape/dsl/routing.rb +++ b/lib/grape/dsl/routing.rb @@ -223,14 +223,14 @@ def routes # # @param param [Symbol] The name of the parameter you wish to declare. # @option options [Regexp] You may supply a regular expression that the declared parameter must meet. - def route_param(param, requirements: nil, type: nil, **options, &) + def route_param(param, requirements: nil, type: nil, **, &) requirements = { param.to_sym => requirements } if requirements.is_a?(Regexp) Grape::Validations::ParamsScope.new(api: self) do requires param, type: type end if type - namespace(":#{param}", requirements: requirements, **options, &) + namespace(":#{param}", requirements: requirements, **, &) end # @return array of defined versions