Skip to content

Add Extended Twingly::URL hasher - #166

Merged
Eric-Twingly merged 5 commits into
masterfrom
v7.1.0/hasher
Sep 15, 2026
Merged

Eric-Twingly merged 5 commits into
masterfrom
v7.1.0/hasher

Conversation

@Eric-Twingly

@Eric-Twingly Eric-Twingly commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

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.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread lib/twingly/url/extended.rb
Comment thread lib/twingly/url/extended.rb
Comment thread lib/twingly/url/extended.rb
Comment thread lib/twingly/url/extended.rb
Comment thread lib/twingly/url/extended.rb
Comment thread lib/twingly/url/extended.rb
@Eric-Twingly Eric-Twingly changed the title V7.1.0/hasher Add Extended Twingly::URL hasher Sep 1, 2026
@Eric-Twingly
Eric-Twingly marked this pull request as ready for review September 1, 2026 13:23

@bjornkellner bjornkellner left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread spec/lib/twingly/url/extended_spec.rb Outdated
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.
@Eric-Twingly

Copy link
Copy Markdown
Contributor Author

It would be easier to review if copied the code from from Tintin in one commit and made the changes in another.

@vikiv480 approves of this message 👍

@bjornkellner bjornkellner left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM :shipit:

@bjornkellner

Copy link
Copy Markdown

maybe update version

@Eric-Twingly
Eric-Twingly merged commit 0780422 into master Sep 15, 2026
18 checks passed
@Eric-Twingly
Eric-Twingly deleted the v7.1.0/hasher branch September 15, 2026 04:49
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.

3 participants