ruby / ruby/uri

Question: Migration from RFC2396 make_regexp to RFC3986

Open
#151 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
125
Forks
65
Avg merge
6h 4m
Merged PRs (30d)
2

Description

I'm doing a bit of warn-housekeeping on Hanami which uses the following (without passing a schema) to match URIs in the asset handling:

ABSOLUTE_URL_MATCHER = URI::DEFAULT_PARSER.make_regexp

This triggers the obsolescence warning since the DEFAULT_PARSER has switched to RFC3986_PARSER which just delegates make_regexp back to the RFC2396_PARSER.

Is there a recommended path forward?

  1. URI::DEFAULT_PARSER.make_regexp --replace-with--> URI::RFC2396_PARSER.make_regexp
  2. URI::DEFAULT_PARSER.make_regexp --replace-with--> URI::RFC3986_Parser::RFC3986_URI

The warning suggest 1, but RFC2396 is obsolete, so rather 2? Or is there a third way? Thanks a lot for any hints!

(Update: Capybara uses the same URI::DEFAULT_PARSER.make_regexp as well, so the same question arises there.)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing URI::DEFAULT_PARSER.make_regexp and the RFC2396_PARSER delegation described in the issue. Compare the proposed RFC2396_PARSER and RFC3986_Parser::RFC3986_URI paths, then check how Hanami and Capybara use the matcher. Done means identifying and documenting a supported replacement that avoids the obsolescence warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.