Preserve keyword arguments across options and builders - #26
Open
OskarEichler wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Preserve keyword arguments through Uber's option and builder forwarding layers on Ruby 3 and 4. This covers generated method/instance-exec wrappers,
Options#evaluate/#eval,Builder#build!/Builders#call, and the still-shipped deprecatedOptions::Valuehelpers andevaluatealias.The guarded Ruby
ruby2_keywordsmechanism retains the existing*argssignatures and positional-hash behavior without introducing runtime syntax newer than the documented Ruby floor. User-provided direct Procs and Callable objects retain their identity.Reproduction
Both calls previously raise
ArgumentErroron Ruby 3.2/4.0. They now return7and{value: 7}. Explicit positional hashes are not promoted to keywords; missing required keywords still raise. Keyword-only instance-exec lambdas and builder declarations fail similarly before the patch.Verification
bundle exec rake test, 45 tests / 50 assertions, zero failures/errors/skips, Ruby 4.0.6 / Minitest 4.7.5.Compatibility / limitations
No intended breaking changes to documented APIs. Calls that previously lost explicit keywords now deliver them to their target. Positional arguments, explicit positional Hashes, empty keywords, static returns, private-method dispatch and unwrapped callable identity retain their behavior.
No new or modified checked-in tests. Ruby 1.9.3–3.1, JRuby, Windows and Linux were not executed locally. The keyword-marker calls are guarded for Ruby versions where the methods do not exist. Main's unrelated test/CI changes are not included in the 0.1.0 consumer backport.