Rename Ruby::Enum to RubyEnum::Enum (Ruby 4.0 support) - #57
Closed
dblock wants to merge 1 commit into
Closed
Conversation
Danger ReportNo issues found. |
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
force-pushed
the
rename-ruby-namespace
branch
from
August 15, 2026 00:56
6db59c3 to
187ab8e
Compare
Closed
dblock
marked this pull request as draft
August 15, 2026 00:59
Owner
Author
|
Closing this — after more research, Ruby 4.0 only reserves the top-level |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ruby 4.0 reserves the top-level
Rubymodule for the language itself (e.g.Ruby::VERSION,Ruby::Box), so this gem reopeningmodule Rubyfor itsRuby::Enumnamespace is now a real conflict, not a hypothetical one.This renames the gem's namespace from
Ruby::EnumtoRubyEnum::Enumand bumps the major version to 2.0.0.Backward compatibility
Ruby::Enum,Ruby::Enum::Case, andRuby::Enum::Errorsremain available as deprecated aliases. IncludingRuby::EnumorRuby::Enum::Caseprints a deprecation warning and delegates toRubyEnum::Enum/RubyEnum::Enum::Case. These aliases will be removed in a future major version.Changes
Ruby::Enum->RubyEnum::Enumthroughoutlib/,spec/,spec_i18n/,README.md,benchmarks/.lib/ruby-enum/deprecated.rbwith the backward-compatibleRuby::Enumshim + tests (spec/ruby-enum/deprecated_spec.rb).2.0.0.CHANGELOG.mdand added an "Upgrading to >= 2.0.0" section toUPGRADING.md.Closes #55.