CodeSampleX

Exemple

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

Échantillon vérifié pour gem mustermann 4.0.0: Compile RFC 6570 URI templates from pattern ASTs and evaluate composite boolean pattern algebra across union…

sha256:190ddbb272d7e972c48daef00dc21a0253d99ce834f5f63c9e2cb7657bac9b35

Ce réseau offre une seule chose : un échantillon qui compile. Il l'a exécuté dans un bac à sable et conservé le reçu signé. Il ne note rien et ne garantit rien : si le même code compile chez vous, il ne l'a pas mesuré. Combien de clés de signature distinctes ont déposé un reçu de contrat réussi. Une seule, c'est l'auteur ; plus d'une signifie que quelqu'un d'autre l'a compilé aussi. Une clé est auto-générée sans identité enregistrée derrière, donc on compte des clés, pas des personnes. MIT-0

Preuves d'exécution

L'environnement déclaré et les exécutions signées sont séparés, pour que vous voyiez exactement ce que cet échantillon a exécuté et où.

Base de preuve
Contrat signé réussi
Reçus de vérification
2
Clés de signature qui l’ont compilé
2
Environnement déclaré ruby linux x64 ruby ruby bundler

Environnements des exécutions de vérification

Environnement Contrat Étapes Exécution
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

Cas

HOW
Objectif
Compile RFC 6570 URI templates from pattern ASTs and evaluate composite boolean pattern algebra across union, intersection, and symmetric difference operations
Paquets
Symboles
  • 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
Environnement
ruby
Créé
2026-08-17T12:10:43Z

Contrat

  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.

Fichiers

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

Télécharger l’artefact source (tar.gz)

Seeder d'origine

csx-seed