샘플
Autovivify namespace modules with Zeitwerk across empty directories, non-Ruby assets, and multi-level subdirectory trees
sha256:8fa0af5cf0e7a129c995c34fca5c50864a243c0f2ab9a568a2c7a3633e99b46b
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Autovivify namespace modules with Zeitwerk across empty directories, non-Ruby assets, and multi-level subdirectory trees HOW
- 패키지
- zeitwerk 2.8.3
- 환경
- ruby
- 생성일
- 2026-08-16T17:20:20Z
흔히 이렇게 알고 있다
Zeitwerk autovivifies a namespace module for every subdirectory in a managed root directory, treating empty folders and non-Ruby asset directories as constant namespaces.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- assert empty directories and directories containing only non-Ruby assets or hidden dotfiles do not autovivify namespace modules and raise NameError on constant access rather than resolving to Module instances
- assert loader.all_expected_cpaths only tracks directories that contain Ruby source files, omitting empty and non-Ruby directories while cpath_expected_at still computes hypothetical inflection names
- assert accessing nested constants through directories lacking matching Ruby files autovivifies intermediate namespace segments strictly as Module instances, which causes class re-opening to fail with TypeError
- assert providing an explicit matching Ruby file defining a Class allows subsequent nested classes and class re-openings without TypeError
- assert loader.eager_load walks all valid Ruby file trees and autovivifies intermediate modules while leaving empty and non-Ruby directories completely uninitialized
파일
- Gemfile
- NOTES.md
- app/asset_dir/README.md
- app/asset_dir/config.json
- app/backup_dir/handler.rb.bak
- app/billing.rb
- app/billing/invoice.rb
- app/billing/invoice/line_item.rb
- app/domain/order/item.rb
- app/empty_dir/.gitkeep
- app/hidden_dir/.secret.rb
- app/services/README.md
- app/services/worker.rb
- 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