Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Gem::SpecificationPolicy#validate_name
validate_name
lib/rubygems/specification_policy.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/rubygems/specification_policy.rb, line 280
def validate_name
name = @specification.name
if !name.is_a?(String)
error "invalid value for attribute name: \"#{name.inspect}\" must be a string"
elsif !/[a-zA-Z]/.match?(name)
error "invalid value for attribute name: #{name.dump} must include at least one letter"
elsif !VALID_NAME_PATTERN.match?(name)
error "invalid value for attribute name: #{name.dump} can only include letters, numbers, dashes, and underscores"
elsif SPECIAL_CHARACTERS.match?(name)
error "invalid value for attribute name: #{name.dump} can not begin with a period, dash, or underscore"
end
end
No documentation available
See also
#validate_metadata
#validate_nil_attributes
#validate_licenses_length
#validate_non_files
also in
4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0