You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modernize argument delegation for Ruby 3+ compatibility
- Replace args.extract_options! with explicit **kwargs parameters
- Update method signatures to use keyword arguments properly
- Add deep_transform_values for handling nested keyword arguments
- Move inherited methods to private sections where appropriate
- Update tests to use **kwargs syntax
- Remove unused active_support/core_ext/array/extract_options require
This modernization improves code clarity and follows Ruby 3+ best practices
while maintaining full backward compatibility.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,9 @@
21
21
*[#2605](https://github.com/ruby-grape/grape/pull/2605): Add Rack 3.2 support with new gemfile and CI integration - [@ericproulx](https://github.com/ericproulx).
22
22
*[#2607](https://github.com/ruby-grape/grape/pull/2607): Remove namespace_stackable and namespace_inheritable from public API - [@ericproulx](https://github.com/ericproulx).
23
23
*[#2615](https://github.com/ruby-grape/grape/pull/2615): Remove manual toc and tod danger check - [@alexanderadam](https://github.com/alexanderadam).
24
-
* Your contribution here.
25
24
*[#2612](https://github.com/ruby-grape/grape/pull/2612): Avoid multiple mount pollution - [@alexanderadam](https://github.com/alexanderadam).
25
+
*[#2618](https://github.com/ruby-grape/grape/pull/2618): Modernize argument delegation for Ruby 3+ compatibility - [@ericproulx](https://github.com/ericproulx).
Copy file name to clipboardExpand all lines: UPGRADING.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,18 @@ Upgrading Grape
3
3
4
4
### Upgrading to >= 3.0.0
5
5
6
+
### Ruby 3+ Argument Delegation Modernization
7
+
8
+
Grape has been modernized to use Ruby 3+'s preferred argument delegation patterns. This change replaces `args.extract_options!` with explicit `**kwargs` parameters throughout the codebase.
9
+
10
+
- All DSL methods now use explicit keyword arguments (`**kwargs`) instead of extracting options from mixed argument lists
11
+
- Method signatures are now more explicit and follow Ruby 3+ best practices
12
+
- The `active_support/core_ext/array/extract_options` dependency has been removed
13
+
14
+
This is a modernization effort that improves code quality while maintaining full backward compatibility.
15
+
16
+
See [#2618](https://github.com/ruby-grape/grape/pull/2618) for more information.
17
+
6
18
### Endpoint execution simplified and `return` deprecated
7
19
8
20
Executing a endpoint's block has been simplified and calling `return` in it has been deprecated.
0 commit comments