Raise error when gem contains capital letters#5432
Merged
hsbt merged 2 commits intoruby:masterfrom Feb 13, 2026
Merged
Conversation
Contributor
|
@simi Are you ok with an error or you prefer a warning? Honestly I would be fine with both. |
simi
reviewed
May 31, 2022
| if name =~ /^\d/ | ||
| Bundler.ui.error "Invalid gem name #{name} Please give a name which does not start with numbers." | ||
| if name =~ /(^\d)|[A-Z]/ | ||
| Bundler.ui.error "Invalid gem name #{name} Please give a name which does not start with numbers nor include capital letters." |
Contributor
Author
There was a problem hiding this comment.
@simi This regex matches when there's only one capital letter.
Contributor
|
I guess a warning for now is probably best. |
|
Other level of this would be to make this warning in specification_policy as well. Anyway this seems like good start. |
60b5ae4 to
1ff89c8
Compare
The problem is described in ruby#5431 The guide ( https://guides.rubygems.org/name-your-gem/ ) says > DON’T USE UPPERCASE LETTERS so `bundle gem` command should respect it.
1ff89c8 to
26dab84
Compare
Member
|
@okuramasafumi I will merge this for warning at first. |
hsbt
added a commit
that referenced
this pull request
Feb 24, 2026
Raise error when gem contains capital letters (cherry picked from commit b7177fa)
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.
The problem is described in #5431
The guide ( https://guides.rubygems.org/name-your-gem/ ) says
What was the end-user or developer problem that led to this PR?
Issue #5431
What is your fix for the problem, implemented in this PR?
It now raises error when gem name includes capital letters.
@simi said warning might be enough, but I thought we don't want to proceed with uppercase letters anyway, so raising error should be fine.
Make sure the following tasks are checked