Skip to content

Rename Ruby::Enum to RubyEnum::Enum (Ruby 4.0 support) - #57

Closed
dblock wants to merge 1 commit into
masterfrom
rename-ruby-namespace
Closed

Rename Ruby::Enum to RubyEnum::Enum (Ruby 4.0 support)#57
dblock wants to merge 1 commit into
masterfrom
rename-ruby-namespace

Conversation

@dblock

@dblock dblock commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

Ruby 4.0 reserves the top-level Ruby module for the language itself (e.g. Ruby::VERSION, Ruby::Box), so this gem reopening module Ruby for its Ruby::Enum namespace is now a real conflict, not a hypothetical one.

This renames the gem's namespace from Ruby::Enum to RubyEnum::Enum and bumps the major version to 2.0.0.

Backward compatibility

Ruby::Enum, Ruby::Enum::Case, and Ruby::Enum::Errors remain available as deprecated aliases. Including Ruby::Enum or Ruby::Enum::Case prints a deprecation warning and delegates to RubyEnum::Enum/RubyEnum::Enum::Case. These aliases will be removed in a future major version.

Changes

  • Renamed Ruby::Enum -> RubyEnum::Enum throughout lib/, spec/, spec_i18n/, README.md, benchmarks/.
  • Added lib/ruby-enum/deprecated.rb with the backward-compatible Ruby::Enum shim + tests (spec/ruby-enum/deprecated_spec.rb).
  • Bumped version to 2.0.0.
  • Updated CHANGELOG.md and added an "Upgrading to >= 2.0.0" section to UPGRADING.md.

Closes #55.

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown

Danger Report

No issues found.

View run

Ruby 4.0 reserves the top-level Ruby module for the language itself,
so reopening 'module Ruby' in this gem is no longer safe. Renames the
gem's namespace from Ruby::Enum to RubyEnum::Enum and bumps the major
version to 2.0.0.

For backward compatibility, Ruby::Enum (and Ruby::Enum::Case,
Ruby::Enum::Errors) remain available as deprecated aliases that warn
on inclusion and delegate to RubyEnum::Enum. They will be removed in
a future major version.

Closes #55.

Co-authored-by: Copilot <[email protected]>
@dblock
dblock force-pushed the rename-ruby-namespace branch from 6db59c3 to 187ab8e Compare August 15, 2026 00:56
@dblock dblock mentioned this pull request Aug 15, 2026
@dblock
dblock marked this pull request as draft August 15, 2026 00:59
@dblock

dblock commented Aug 15, 2026

Copy link
Copy Markdown
Owner Author

Closing this — after more research, Ruby 4.0 only reserves the top-level Ruby module for its own constants (Ruby::VERSION, Ruby::Box, etc.), it doesn't prevent gems from reopening/extending the module. Since we only define Ruby::Enum (not Ruby itself), there's no actual conflict, so the rename isn't necessary. Sorry for the noise.

@dblock dblock closed this Aug 15, 2026
@dblock
dblock deleted the rename-ruby-namespace branch August 15, 2026 01:00
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.

Ruby 4 support

1 participant