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

Avoid a deprecation warning on Ruby 3.4 with the uri gem #2618

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

Earlopain
Copy link
Contributor

@Earlopain Earlopain commented Sep 25, 2024

Motivation

Calling URI::DEFAULT_PARSER.escape emits a deprecation warning with the uri gem shipped with Ruby 3.4:

lib/core_ext/uri.rb:23: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly.

Implementation

Check for the precence of the new RFC2396_PARSER constant and use that if available. Otherwise fall back to DEFAULT_PARSER, which will be an RFC2396_Parser instance in that case.

Tapioca changes: Shopify/tapioca#2026

Automated Tests

n/A

Manual Tests

Run tests with ruby-head and warnings enabled: RUBYOPT=-w VERBOSE=1 bundle exec rake

lib/core_ext/uri.rb Outdated Show resolved Hide resolved
@vinistock vinistock added server This pull request should be included in the server gem's release notes other Changes that aren't bugfixes, enhancements or breaking changes labels Sep 30, 2024
I openend a PR to tapioca, which needs the same change: Shopify/tapioca#2026
@Earlopain Earlopain marked this pull request as ready for review October 1, 2024 16:32
@Earlopain Earlopain requested a review from a team as a code owner October 1, 2024 16:32
Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution!

@vinistock vinistock merged commit d7bcfc1 into Shopify:main Oct 1, 2024
19 checks passed
@Earlopain Earlopain deleted the uri-parser-changes branch October 3, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other Changes that aren't bugfixes, enhancements or breaking changes server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants