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

Add uri_parser method for RFC2396 compatibility #398

Merged
merged 1 commit into from
Sep 1, 2024

Conversation

tagliala
Copy link
Contributor

@tagliala tagliala commented Aug 29, 2024

Description

This commit introduces a new method Axlsx#uri_parser to handle URI parsing in a way that's compatible with both newer and older versions of Ruby's URI library. It checks for the presence of URI::RFC2396_PARSER and falls back to URI::DEFAULT_PARSER if not available, ensuring consistent behavior across different Ruby versions.

Close #397

Ref: ruby/uri#114

Your checklist for this pull request

  • I have reviewed the guidelines for contributing to this repository.
  • I have added (or updated) appropriate tests if this PR fixes a bug or adds a feature.
  • If this PR doesn't need tests (docs change), I added [ci skip] to the title of the PR.
  • If this closes any issues, I have added "Closes #issue" to the PR description or my commit messages.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • I added an entry to the changelog.

Copy link
Member

@kiskoza kiskoza left a comment

Choose a reason for hiding this comment

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

Looks good to me. Could you add it to the changelog as well?

This commit introduces a new method `Axlsx#uri_parser` to handle
URI parsing in a way that's compatible with both newer and older
versions of Ruby's URI library. It checks for the presence of
`URI::RFC2396_PARSER` and falls back to `URI::DEFAULT_PARSER` if
not available, ensuring consistent behavior across different Ruby
versions.

Close caxlsx#397

Ref: ruby/uri#114
@tagliala tagliala force-pushed the chore/397-fix-parser-deprecation branch from 86b9ec1 to 4bc15ef Compare September 1, 2024 07:13
@tagliala tagliala marked this pull request as draft September 1, 2024 07:15
@tagliala tagliala marked this pull request as ready for review September 1, 2024 07:22
@tagliala
Copy link
Contributor Author

tagliala commented Sep 1, 2024

Done. This can be improved by extracting the regexp to a constant.

However, since drawing is required before Axlsx main module, at that point Axlsx.uri_parser is not defined yet. I'm going to submit at least another PR to improve core dependency requires

@kiskoza kiskoza merged commit 421fbda into caxlsx:master Sep 1, 2024
12 checks passed
@tagliala tagliala deleted the chore/397-fix-parser-deprecation branch September 1, 2024 12:09
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.

Ruby 3.4 warning: URI::RFC3986_PARSER.make_regexp is obsoleted. Use URI::RFC2396_PARSER.make_regexp explicitly
2 participants