Skip to content

v0.2.2 — tsip-core class-alias surface

Choose a tag to compare

@team-milestone-alfonso team-milestone-alfonso released this 19 Apr 10:05
· 2 commits to main since this release

Gem-only release per docs/V0_2_2_HANDOFF.md. No crate change — tsip-parser = \"0.2\" still resolves to 0.2.1.

What changed

Exposes three crate class methods that tsip-core needs to replace its per-parse bridge shim with a direct TsipCore::Sip::Uri = TsipParser::Uri class alias. Closes the −2.8% throughput regression measured in the tsip-core integration bench on 2026-04-19.

  • TsipParser::Uri.parse_range(str, from, to) — byte-range parse. tsip-core's Address.parse uses this to parse the URI inside <...> without substring alloc. Offsets are validated + must land on UTF-8 char boundaries; raises ParseError otherwise.
  • TsipParser::Uri.parse_param(raw, hash) — writes one key[=value] segment into an existing Ruby Hash. Used by tsip-core Via.parse on each semicolon-split segment. Key-only segments insert \"\"; empty raw is a no-op; duplicate keys overwrite.
  • TsipParser::Uri.parse_host_port(str) — returns [host, port_or_nil]. IPv6 bracket form ([::1]:5060) supported.

Not added (per HANDOFF §3.3)

Address.new(display_name:, uri:, params:) kwargs constructor. tsip-core is adding an Address.build(...) helper on its side instead.

Tests

39 runs / 67 assertions / 0 failures — 25 existing + 14 new class-method tests.

Install

gem install tsip_parser

RubyGems: https://rubygems.org/gems/tsip_parser/versions/0.2.2