Ejemplo
Autoload constants into a scoped namespace module with custom inflections and on_load callbacks using Zeitwerk::Loader
sha256:e992e1b230069007c74a915672516f01e1c4fc1314b5627a7505949ffaae9e7a
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- ruby
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- ruby
- Lenguaje
- ruby
- Gestor de paquetes
- bundler
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- ruby 3
- Sistema operativo
- linux debian · glibc
- Arquitectura
- x64
- Runtime
- ruby 3
- Lenguaje
- ruby
- Gestor de paquetes
- bundler
- Ejecución
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17
Caso
- Objetivo
- Autoload constants into a scoped namespace module with custom inflections and on_load callbacks using Zeitwerk::Loader HOW
- Paquetes
-
zeitwerk 2.8.3
- Entorno
- ruby
- Creado
- 2026-08-17T14:52:26Z
Contrato
- Zeitwerk::Loader scopes autoloaded constants within a custom namespace module when registered with push_dir(..., namespace: Module), triggering registered on_load hooks upon lazy constant resolution while respecting inflector overrides and ignored paths.
- Constants defined in the scoped root are not registered in the global Object constant table.
- Custom inflection rules registered with loader.inflector.inflect determine the constant name mapped to snake_case filenames.
- Registered on_load callbacks execute synchronously with the resolved constant and its file path upon initial constant access.
- Ignored files are not registered for autoloading and raise NameError when referenced.
Archivos
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
- test/fixtures/admin/dashboard.rb
- test/fixtures/admin/internal_secret.rb
- test/fixtures/admin/reports/sales_metric.rb
- test/fixtures/admin/xml_http_request.rb
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- ruby 3 · linux debian/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9