Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Requires gem names to have at least one alpha character #476

Merged
merged 1 commit into from

2 participants

@adkron
Collaborator

Issue #426

@adkron and @sandersch

@cmeiklejohn cmeiklejohn merged commit 16ab2f3 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +1 −1  app/models/rubygem.rb
  2. +1 −0  test/unit/rubygem_test.rb
View
2  app/models/rubygem.rb
@@ -250,7 +250,7 @@ def first_built_date
def ensure_name_format
if name.class != String
errors.add :name, "must be a String"
- elsif name =~ /\A[\d]+\Z/
+ elsif name !~ /[a-zA-Z]+/
errors.add :name, "must include at least one letter"
elsif name !~ NAME_PATTERN
errors.add :name, "can only include letters, numbers, dashes, and underscores"
View
1  test/unit/rubygem_test.rb
@@ -20,6 +20,7 @@ class RubygemTest < ActiveSupport::TestCase
should allow_value("rack-test").for(:name)
should allow_value("perftools.rb").for(:name)
should_not allow_value("\342\230\203").for(:name)
+ should_not allow_value("2.2").for(:name)
should "reorder versions with platforms properly" do
version3_ruby = create(:version, :rubygem => @rubygem, :number => "3.0.0", :platform => "ruby")
Something went wrong with that request. Please try again.