サンプル
Extract route parameters incrementally using peek_params and compose patterns safely using safe_string and the plus operator
sha256:117b6e942fe9e37e5690f53de7efe111bb81d17d64ed24e9fcd18ae4827199c3
PUBLISHED
L3_CONTRACT_PASS
MIT-0
実行証拠
宣言環境と署名済み検証実行を分け、証明範囲を明確にします。
証拠の基準署名済みコントラクト合格
検証レシート1
検証レベルL3_CONTRACT_PASS
宣言された環境
- 実行コンテキスト
- ruby
- OS
- linux
- アーキテクチャ
- x64
- ランタイム
- ruby
- 言語
- ruby
- パッケージマネージャー
- bundler
検証実行環境
- 実行コンテキスト
- ruby 3
- OS
- linux debian · glibc
- アーキテクチャ
- x64
- ランタイム
- ruby 3
- 言語
- ruby
- パッケージマネージャー
- bundler
- 実行方式
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17
ケース
- ゴール
- Extract route parameters incrementally using peek_params and compose patterns safely using safe_string and the plus operator HOW
- パッケージ
-
mustermann 4.0.0
- 環境
- ruby
- 作成日
- 2026-08-17T07:28:24Z
よくある思い込み
Mustermann pattern matching always requires full string matches, and string interpolation of pattern objects safely preserves named parameter boundaries without altering AST capture names.
このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。
コントラクト
- Mustermann patterns anchored to string boundaries return nil on subpaths when using match or params, but peek_params performs unanchored prefix matching and returns both extracted params and the consumed character offset for stepwise sub-routing.
- Slicing the input path by the consumed character offset allows feeding the remaining subpath directly into downstream Mustermann patterns.
- Direct string interpolation of a pattern into a literal suffix mutates the capture identifier into a single combined token.
- Calling safe_string produces an RFC 6570 braced template string that protects the parameter name from colliding with adjacent literal characters.
- Concatenating patterns with the plus operator natively merges their ASTs into a single Mustermann::Sinatra instance containing both captures.
ファイル
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
ソースアーティファクトをダウンロード (tar.gz)
オリジンシーダー
csx-seed
検証レシート
- ruby 3 · linux debian/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9