Restrict special chars from prefixing new gem names#2432
Merged
2 commits merged intomasterfrom Oct 10, 2018
Merged
Conversation
Contributor
Author
|
Thanks for the review @colby-swandale! |
Contributor
Author
|
@bundlerbot r+ |
ghost
pushed a commit
that referenced
this pull request
Oct 10, 2018
2432: Restrict special chars from prefixing new gem names r=bronzdoc a=bronzdoc # Description: closes #2430 A user should not be able to create a gem with a `.`, `-` or `_` as a prefix in a gem name ______________ # Tasks: - [ ] Describe the problem / feature - [ ] Write tests - [ ] Write code to solve the problem - [ ] Get code review from coworkers / friends I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md). Co-authored-by: Luis Sagastume <lsagastume1990@gmail.com>
Build succeeded |
|
I know it's silly, but I was depending on this behaviour for https://pre-commit.com to pick a gem name that would never conflict. I've gone through and fixed all of my uses but unfortunately I've caused to be a pattern. This wasn't called out at all in the 3.0 changelog despite being a breaking change, it might be good to call that out. For others seeing the error message, the message is (in my case): |
jumanjiman
added a commit
to jumanjihouse/pre-commit-hooks
that referenced
this pull request
Jan 15, 2019
Change name of `__fake_gem` to `fake_gem__` for rubygems 3.x compatibility
The name `__fake_gem` is incompatible with `rubygems >= 3`. This changes the name to `fake_gem__`. I'm open to other ideas for naming but figured this had just as little chance of a name collision as the previous name which seemed like the original intent.
Symptom:
```
An unexpected error has occurred: CalledProcessError: Command: ('/usr/local/bin/ruby', u'/usr/local/bin/gem', 'build', '__fake_gem.gemspec')
Errors:
WARNING: See http://guides.rubygems.org/specification-reference/ for help
ERROR: While executing gem ... (Gem::InvalidSpecificationException)
invalid value for attribute name: "__fake_gem" can not begin with a period, dash, or underscore
```
Reference:
ruby/rubygems#2432 (comment)
This pull request was closed.
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.
Description:
closes #2430
A user should not be able to create a gem with a
.,-or_as a prefix in a gem nameTasks:
I will abide by the code of conduct.