示例
Detect a mismatched constant definition in Zeitwerk 2.6.0
sha256:e79d7fbde23f88b21dd9a8c2975f77a34805c07c60bfddbae43c7a862f4d57fd
PUBLISHED
L3_CONTRACT_PASS
MIT-0
案例
- 目标
- Detect a mismatched constant definition in Zeitwerk 2.6.0 HOW
- 包
- zeitwerk 2.6.0
- 环境
- ruby
- 创建时间
- 2026-08-17T02:50:27Z
常见的想当然
Zeitwerk silently skips a file that defines a different constant than its path implies
这是本样本作者记下的、开发者或模型在此处通常会有的预期。下面的契约才是真正运行过的东西。
契约
- Accessing Foo when lib/foo.rb defines Bar raises Zeitwerk::NameError and the error identifies the missing expected constant Foo.
文件
- Gemfile
- Gemfile.lock
- csx.json
- lib/foo.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