Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forbid uppercase characters in gem names #378

Closed
djberg96 opened this issue Jan 12, 2012 · 7 comments
Closed

Forbid uppercase characters in gem names #378

djberg96 opened this issue Jan 12, 2012 · 7 comments

Comments

@djberg96
Copy link

Currently there's nothing to prevent users from uploading gems with identical names differing only by case. This could lead to serious confusion. And, in fact, I've seen it happen with CPAN.

I propose that, in the future, all gem names be automatically downcased either at gem creation time or gem push time. Current gems with uppercase characters would be grandfathered in, but going forward, no gems with uppercase characters!

@RichMorin
Copy link

I'd like to consider using the model that domain names follow - case isn't required to match, but uniqueness of down-cased names is preserved.

@drbrain
Copy link
Member

drbrain commented Jan 12, 2012

I agree.

This could be accomplished by gem push rejecting a gem with uppercase letters unless it has been released once before.

@sferik
Copy link
Member

sferik commented Jan 12, 2012

Agreed. Also, gem URLs should be case insensitive, for example https://rubygems.org/gems/zentest should resolve to the same page as https://rubygems.org/gems/ZenTest (currently it 404s).

Even for gems that already exist, gem push should show a deprecation warning if it contains capital letters.

@ghost
Copy link

ghost commented Jan 12, 2012

Seems to me that this is a change that should be approached cautiously. While I'm in favor of preventing confusion, there are a couple of factors I'd like to see considered:

  1. The use of internal caps to delineate words is a long-standing tradition. Heck, even RubyGems is a common usage. So while I'd be in favor of matching on a lower-case basis, I don't see any reason to prevent people from pushing gems with whatever case they like (so long as the lower case is unique). That is, I think we should continue to accept MyAwesomeGem (so long as no variant by case-only of that name already exists), but have gem install MyAwesomeGem, gem install myawesomegem, and gem install MYAWESOMEGEM all find it.

  2. If we're going to get into the "prevent confusion" business, there really should be a policy about misleading Unicode characters as well. The world is not just upper and lower case ASCII. Mind you, I don't know what the policy should be, but if rubygems is going to limit the namespace it'd be nice to have it done ONCE instead of iteratively as people find new ways to game the system.

@drbrain
Copy link
Member

drbrain commented Jan 12, 2012

@ffmike Existing capitalized gems would be grandfathered and future gems would be expected to follow these guidelines: http://blog.segment7.net/2010/11/15/how-to-name-gems

Gems names should be restricted to US-ASCII alphanumeric for maximum filesystem compatibility, so the gem's name would need to match /\A[a-z\d_-]+\z/

@amateurhuman
Copy link
Contributor

Duplicated in #421
Fixed with #481

@cmeiklejohn
Copy link
Contributor

Closing.

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

No branches or pull requests

6 participants