Пример
Handle Mustermann capture type casting across built-in AST converters, POSIX character classes, polymorphic converter unions, and expand roundtripping
sha256:876d66cea0502af8f4f6e05ed74179faedec2c610e764f8afdc67e86ad937985
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Handle Mustermann capture type casting across built-in AST converters, POSIX character classes, polymorphic converter unions, and expand roundtripping HOW
- Пакеты
- mustermann 4.0.0
- Окружение
- ruby
- Создан
- 2026-08-16T15:55:35Z
Что обычно предполагают
Mustermann capture options accept arbitrary Ruby classes and parse them on match, while all other capture groups return raw String parameters.
Автор образца записал здесь то, чего ожидал бы разработчик или модель. Контракт ниже — это то, что действительно выполнялось.
Контракт
- Mustermann capture options only accept built-in converter types (Date, Gem::Version, Float, Integer, Symbol), raising Mustermann::CompileError on arbitrary classes like Time while typecasting extracted parameters into Ruby class instances and round-tripping them through expand.
- Passing an array of capture types such as [Integer, Date, :slug] creates a polymorphic capture that matches and dynamically casts each segment to its matching Ruby type or string.
- Symbol constraints that are not built-in converter names (such as :alpha or :alnum) compile to POSIX character classes and return uncasted String parameters.
- Typed parameter hashes containing Date, Gem::Version, Float, Symbol, and Integer instances serialize back into canonical URL paths via expand without requiring string conversion.
Файлы
- Gemfile
- NOTES.md
- csx.json
- test/contract.rb
Скачать проверенный артефакт (tar.gz) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9