CodeSampleX

サンプル

mustermann 4.0.0: Compile RFC 6570 URI templates from pattern ASTs and evaluate composite boolean pattern algebra across union, intersection, and symmetric difference operations

検証済みサンプル — gem mustermann 4.0.0: Compile RFC 6570 URI templates from pattern ASTs and evaluate composite boolean pattern algebra across union, intersection…

sha256:190ddbb272d7e972c48daef00dc21a0253d99ce834f5f63c9e2cb7657bac9b35

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。 MIT-0

実行証拠

宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。

証拠の基準
署名済みコントラクト合格
検証レシート
2
ビルドした署名鍵
2
宣言された環境 ruby linux x64 ruby ruby bundler

検証実行環境

環境 コントラクト ステージ 実行日
ruby 3 · linux debian/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · rubygems@1
2026-08-17
ruby 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · rubygems@1
2026-08-18

ケース

HOW
ゴール
Compile RFC 6570 URI templates from pattern ASTs and evaluate composite boolean pattern algebra across union, intersection, and symmetric difference operations
パッケージ
シンボル
  • Mustermann.new
  • Mustermann::Pattern#to_templates
  • Mustermann::Composite
  • Mustermann::Pattern#&
  • Mustermann::Pattern#^
  • Mustermann::Pattern#|
  • Mustermann::Pattern#names
  • Mustermann::Pattern#to_proc
  • Mustermann::Sinatra
  • Mustermann::Regular
環境
ruby
作成日
2026-08-17T12:10:43Z

コントラクト

  1. Mustermann AST patterns compile into RFC 6570 URI template strings via to_templates, converting named captures to standard expressions, splats to reserved-character expansions, and optional segments into distinct permutation templates.
  2. Regexp-based patterns (Mustermann::Regular) do not support template generation, reporting false on respond_to?(:to_templates) and raising NotImplementedError when to_templates is invoked.
  3. Pattern intersection with & creates a Mustermann::Composite matching paths that satisfy both sub-patterns (logical AND) and extracting parameters from the first matching sub-pattern.
  4. Pattern symmetric difference with ^ creates a Mustermann::Composite matching paths that satisfy exactly one sub-pattern (logical XOR), returning false when both match or neither matches.
  5. Mustermann::Composite unifies member capture names in names and dynamically supports to_templates only when configured with the union operator (|) across member patterns that all support AST template generation.
  6. Composite patterns implement to_proc delegating to ===, enabling integration with Ruby Enumerable methods including select, grep, detect, and reject.

ファイル

  • Gemfile
  • Gemfile.lock
  • NOTES.md
  • csx.json
  • lib/pattern_composer.rb
  • test/contract.rb

ソースアーティファクトをダウンロード (tar.gz)

オリジンシーダー

csx-seed