Skip to content

Add Module#deprecate_constant - #499

Merged
tannevaled merged 1 commit into
mainfrom
feat/deprecate-constant
Aug 30, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/deprecate-constant

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Module#deprecate_constant(*names) marks existing constants deprecated (a new
per-module set); reading one — through Foo::CONST or Module#const_get — warns
constant Foo::CONST is deprecated when Warning[:deprecated] is enabled, and is
silent otherwise. An undefined name raises NameError.

Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
ratchet floor rises 16280 → 16282 (core/module/deprecate_constant 0 → 2, the
rest of the spec exercising the warning via the unsupported complain matcher,
zero regressions in a per-file sweep).

🤖 Generated with Claude Code

Module#deprecate_constant(*names) marks existing constants deprecated (a new
per-module set); reading one — through Foo::CONST or Module#const_get — warns
"constant Foo::CONST is deprecated" when Warning[:deprecated] is enabled, and is
silent otherwise. An undefined name raises NameError.

Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
floor rises 16280 -> 16282 (core/module/deprecate_constant 0 -> 2, the rest of the
spec exercising the warning via the unsupported complain matcher).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled force-pushed the feat/deprecate-constant branch from 0094b3e to 906bbf7 Compare August 30, 2026 08:52
@tannevaled
tannevaled merged commit c741c06 into main Aug 30, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/deprecate-constant branch August 30, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant