Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run CI against Ruby 3.2 #742

Merged
merged 2 commits into from Apr 10, 2023
Merged

Run CI against Ruby 3.2 #742

merged 2 commits into from Apr 10, 2023

Conversation

koheisg
Copy link
Contributor

@koheisg koheisg commented Mar 24, 2023

No description provided.

@koheisg koheisg changed the title Ruby 3 2 Run CI against Ruby 3.2 Mar 24, 2023
Comment on lines +17 to +21
x = if RUBY_VERSION >= "3.2.0"
Data.define(:to_hash).new(:to_hash => { "accept" => "json" })
else
Struct.new(:to_hash).new({ "accept" => "json" })
end
Copy link
Contributor Author

@koheisg koheisg Mar 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
x = if RUBY_VERSION >= "3.2.0"
Data.define(:to_hash).new(:to_hash => { "accept" => "json" })
else
Struct.new(:to_hash).new({ "accept" => "json" })
end
Struct.new(:to_hash, keyword_init: false).new("accept" => "json")

If this is the case, the code will not branch by version, but keyword_init: false will cause rubocop to say `Use hash rockets syntax.

@tarcieri
Copy link
Member

@koheisg a separate issue, but it's probably about time we changed from hashrockets to keyword args in general

@koheisg
Copy link
Contributor Author

koheisg commented Mar 25, 2023

@tarcieri OK ruby 3.2 support first! Thanks.

@ixti ixti merged commit 4e0696c into httprb:main Apr 10, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants