Add Extended Twingly::URL hasher - #166
Merged
Merged
Conversation
Ported code uses Ruby 3+ specific code which requires upgrading version, and pins public suffix to guarantee consistent behavior.
Port of existing extended normalization and hashing. Strips query and matrix parameters, and adds a legacy hash.
Drop the ruby 2.6 and 2.7 CI jobs: they fail at bundle install now that the gemspec requires Ruby >= 3.0, so the matrix starts at the supported floor. Spell out `url: url` instead of hash value-omission in extended_spec — the shorthand is Ruby 3.1+ syntax and was a SyntaxError on the CI ruby 3.0 job, contradicting the gemspec's claimed minimum.
There was a problem hiding this comment.
Pull request overview
Adds extended URL normalization and hashing while raising the minimum Ruby version.
Changes:
- Adds parameter filtering, normalization, and legacy/current URL hashes.
- Adds comprehensive specifications and README documentation.
- Updates supported Ruby and dependency versions.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
lib/twingly/url/extended.rb |
Implements extended normalization and hashing. |
spec/lib/twingly/url/extended_spec.rb |
Tests the extended API. |
README.md |
Documents extended URL handling. |
twingly-url.gemspec |
Requires Ruby 3.0+. |
Gemfile |
Pins public_suffix for development. |
.ruby-version |
Selects Ruby 3.3.7 locally. |
.github/workflows/ci.yml |
Removes Ruby 2.x CI jobs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Eric-Twingly
marked this pull request as ready for review
September 1, 2026 13:23
bjornkellner
approved these changes
Sep 2, 2026
bjornkellner
left a comment
There was a problem hiding this comment.
Nice!
It would be easier to review if copied the code from from Tintin in one commit and made the changes in another.
I haven't looked at most of the code. I made a local diff against tintin and reviewed that
Move the normalization assertions out of .normalize_and_calculate_urlhash into dedicated #normalized and #original_url_without_blacklisted_parameters describes, using the same subject/let style as the Twingly::URL specs and remove the base-class isolation tests.
Contributor
Author
|
|
maybe update version |
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.
Adds Twingly::URL::Extended: extended normalization and hashing that strips blacklisted query/matrix parameters and the fragment.
Verbatim port of https://github.com/twingly/tintin/blob/master/lib/url_hasher.rb.