Skip to content

Commit b9bc39f

Browse files
committed
-Drop support ruby 3.0 and ActiveSupport 7.0
- Updated Rubocop TargetVersion in fix issues automatically
1 parent bf90e95 commit b9bc39f

File tree

15 files changed

+38
-46
lines changed

15 files changed

+38
-46
lines changed

.github/workflows/edge.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ jobs:
66
strategy:
77
fail-fast: false
88
matrix:
9-
ruby: ['3.0', '3.1', '3.2', '3.3', '3.4', ruby-head, truffleruby-head, jruby-head]
9+
ruby: ['3.1', '3.2', '3.3', '3.4', ruby-head, truffleruby-head, jruby-head]
1010
gemfile: [rails_edge, rack_edge]
1111
exclude:
12-
- ruby: '3.0'
13-
gemfile: rails_edge
1412
- ruby: '3.1'
1513
gemfile: rails_edge
1614
runs-on: ubuntu-latest

.github/workflows/test.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
ruby: ['3.0', '3.1', '3.2', '3.3', '3.4']
26+
ruby: ['3.1', '3.2', '3.3', '3.4']
2727
gemfile: [Gemfile, gemfiles/rack_2_0.gemfile, gemfiles/rack_3_0.gemfile, gemfiles/rack_3_1.gemfile, gemfiles/rack_3_2.gemfile, gemfiles/rails_7_0.gemfile, gemfiles/rails_7_1.gemfile, gemfiles/rails_7_2.gemfile, gemfiles/rails_8_0.gemfile, gemfiles/rails_8_1.gemfile]
2828
specs: ['spec --exclude-pattern=spec/integration/**/*_spec.rb']
2929
include:
@@ -49,12 +49,6 @@ jobs:
4949
gemfile: gemfiles/rails_8_0.gemfile
5050
specs: 'spec/integration/rails'
5151
exclude:
52-
- ruby: '3.0'
53-
gemfile: gemfiles/rails_7_2.gemfile
54-
- ruby: '3.0'
55-
gemfile: gemfiles/rails_8_0.gemfile
56-
- ruby: '3.0'
57-
gemfile: gemfiles/rails_8_1.gemfile
5852
- ruby: '3.1'
5953
gemfile: gemfiles/rails_8_0.gemfile
6054
- ruby: '3.1'

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
AllCops:
22
NewCops: enable
3-
TargetRubyVersion: 3.0
3+
TargetRubyVersion: 3.1
44
SuggestExtensions: false
55
Exclude:
66
- vendor/**/*

.rubocop_todo.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2025-11-15 17:39:14 UTC using RuboCop version 1.81.7.
3+
# on 2025-12-20 20:56:19 UTC using RuboCop version 1.81.7.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -145,12 +145,11 @@ Style/CombinableLoops:
145145
Exclude:
146146
- 'spec/grape/endpoint_spec.rb'
147147

148-
# Offense count: 11
148+
# Offense count: 10
149149
# Configuration parameters: AllowedMethods.
150150
# AllowedMethods: respond_to_missing?
151151
Style/OptionalBooleanParameter:
152152
Exclude:
153-
- 'lib/grape/dsl/inside_route.rb'
154153
- 'lib/grape/dsl/parameters.rb'
155154
- 'lib/grape/endpoint.rb'
156155
- 'lib/grape/serve_stream/sendfile_response.rb'

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* [#2643](https://github.com/ruby-grape/grape/pull/2638): Remove `try` method in codebase - [@ericproulx](https://github.com/ericproulx).
1313
* [#2646](https://github.com/ruby-grape/grape/pull/2646): Call `valid_encoding?` before scrub - [@ericproulx](https://github.com/ericproulx).
1414
* [#2644](https://github.com/ruby-grape/grape/pull/2644): Clean useless/not valuable dependencies - [@ericproulx](https://github.com/ericproulx).
15+
* [#2649](https://github.com/ruby-grape/grape/pull/2644): Drop support Ruby 3.0 and ActiveSupport 7.0 - [@ericproulx](https://github.com/ericproulx).
1516
* Your contribution here.
1617

1718
#### Fixes

grape.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
2020
'rubygems_mfa_required' => 'true'
2121
}
2222

23-
s.add_dependency 'activesupport', '>= 7.0'
23+
s.add_dependency 'activesupport', '>= 7.1'
2424
s.add_dependency 'dry-configurable'
2525
s.add_dependency 'dry-types', '>= 1.1'
2626
s.add_dependency 'mustermann-grape', '~> 1.1.0'
@@ -29,5 +29,5 @@ Gem::Specification.new do |s|
2929

3030
s.files = Dir['lib/**/*', 'CHANGELOG.md', 'CONTRIBUTING.md', 'README.md', 'grape.png', 'UPGRADING.md', 'LICENSE', 'grape.gemspec']
3131
s.require_paths = ['lib']
32-
s.required_ruby_version = '>= 3.0'
32+
s.required_ruby_version = '>= 3.1'
3333
end

lib/grape/dsl/helpers.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ def include_block(block)
5050
end
5151
end
5252

53-
def make_inclusion(mod, &block)
53+
def make_inclusion(mod, &)
5454
define_boolean_in_mod(mod)
55-
inject_api_helpers_to_mod(mod, &block)
55+
inject_api_helpers_to_mod(mod, &)
5656
inheritable_setting.namespace_stackable[:helpers] = mod
5757
end
5858

lib/grape/dsl/parameters.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ def optional(*attrs, **opts, &block)
160160
# Define common settings for one or more parameters
161161
# @param (see #requires)
162162
# @option (see #requires)
163-
def with(*attrs, &block)
163+
def with(*attrs, &)
164164
new_group_attrs = [@group, attrs.clone.first].compact.reduce(&:deep_merge)
165-
new_group_scope([new_group_attrs], &block)
165+
new_group_scope([new_group_attrs], &)
166166
end
167167

168168
%i[mutually_exclusive exactly_one_of at_least_one_of all_or_none_of].each do |validator|
@@ -178,12 +178,12 @@ def with(*attrs, &block)
178178
# @raise Grape::Exceptions::UnknownParameter if `attr` has not been
179179
# defined in this scope yet
180180
# @yield a parameter definition DSL
181-
def given(*attrs, &block)
181+
def given(*attrs, &)
182182
attrs.each do |attr|
183183
proxy_attr = first_hash_key_or_param(attr)
184184
raise Grape::Exceptions::UnknownParameter.new(proxy_attr) unless declared_param?(proxy_attr)
185185
end
186-
new_lateral_scope(dependent_on: attrs, &block)
186+
new_lateral_scope(dependent_on: attrs, &)
187187
end
188188

189189
# Test for whether a certain parameter has been defined in this params

lib/grape/dsl/routing.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ module DSL
55
module Routing
66
attr_reader :endpoints
77

8-
def given(conditional_option, &block)
8+
def given(conditional_option, &)
99
return unless conditional_option
1010

11-
mounted(&block)
11+
mounted(&)
1212
end
1313

1414
def mounted(&block)
@@ -157,7 +157,7 @@ def mount(mounts, *opts)
157157
# {hello: 'world'}
158158
# end
159159
# end
160-
def route(methods, paths = ['/'], route_options = {}, &block)
160+
def route(methods, paths = ['/'], route_options = {}, &)
161161
method = methods == :any ? '*' : methods
162162
endpoint_params = inheritable_setting.namespace_stackable_with_hash(:params) || {}
163163
endpoint_description = inheritable_setting.route[:description]
@@ -171,7 +171,7 @@ def route(methods, paths = ['/'], route_options = {}, &block)
171171
path: paths,
172172
for: self,
173173
route_options: all_route_options,
174-
&block
174+
&
175175
)
176176
endpoints << new_endpoint unless endpoints.any? { |e| e.equals?(new_endpoint) }
177177

@@ -223,7 +223,7 @@ def routes
223223
#
224224
# @param param [Symbol] The name of the parameter you wish to declare.
225225
# @option options [Regexp] You may supply a regular expression that the declared parameter must meet.
226-
def route_param(param, **options, &block)
226+
def route_param(param, **options, &)
227227
options = options.dup
228228

229229
options[:requirements] = {
@@ -234,7 +234,7 @@ def route_param(param, **options, &block)
234234
requires param, type: options[:type]
235235
end if options.key?(:type)
236236

237-
namespace(":#{param}", options, &block)
237+
namespace(":#{param}", options, &)
238238
end
239239

240240
# @return array of defined versions

lib/grape/dsl/validations.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ module Validations
66
# Opens a root-level ParamsScope, defining parameter coercions and
77
# validations for the endpoint.
88
# @yield instance context of the new scope
9-
def params(&block)
10-
Grape::Validations::ParamsScope.new(api: self, type: Hash, &block)
9+
def params(&)
10+
Grape::Validations::ParamsScope.new(api: self, type: Hash, &)
1111
end
1212

1313
# Declare the contract to be used for the endpoint's parameters.

0 commit comments

Comments
 (0)