샘플
Configure code reloading with Zeitwerk before setup and manage reload lifecycle without ReloadingDisabledError or silent unload failures
sha256:3aed1aec35956317dc802d4cbf7266ff5aa5230d8c32e41cade6cadb5f1fbb5f
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Configure code reloading with Zeitwerk before setup and manage reload lifecycle without ReloadingDisabledError or silent unload failures HOW
- 패키지
- zeitwerk 2.8.3
- 환경
- ruby
- 생성일
- 2026-08-17T01:22:47Z
흔히 이렇게 알고 있다
Calling loader.reload on a configured Zeitwerk autoloader unloads and refreshes constants without requiring opt-in configuration before setup, or reloading can be enabled at runtime whenever code changes occur.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- assert calling loader.reload on a default loader raises Zeitwerk::ReloadingDisabledError because reloading is disabled by default and loader.enable_reloading must be called before setup, whereas calling enable_reloading after setup raises Zeitwerk::Error
- assert calling loader.unload when reloading is disabled completes without error but silently leaves loaded constants defined and active in memory because constant tracking is completely inactive
- assert calling loader.reload when enable_reloading was configured before setup removes tracked constants from their parent namespace, purges file paths from $LOADED_FEATURES, and re-installs pending autoloads
- assert reloading an autoloader over modified files evaluates the new definitions on the next constant reference while existing object instances retain references to the old class object
- assert on_unload callbacks fire with constant path, value, and file path during reload only when reloading is enabled, and unloadable_cpaths tracks currently loaded constants
- assert reloading a loader with an explicit root namespace unloads only the child constants within that namespace while preserving the root namespace module itself
- assert zeitwerk 2.8.3 is pure Ruby with zero runtime dependencies
파일
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/reloading.rb
- test/contract.rb
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9