Method: Gem::Version.correct?

Defined in:
lib/rubygems/version.rb

.correct?(version) ⇒ Boolean

True if the version string matches RubyGems’ requirements.

Returns:

  • (Boolean)


173
174
175
176
177
# File 'lib/rubygems/version.rb', line 173

def self.correct?(version)
  nil_versions_are_discouraged! if version.nil?

  ANCHORED_VERSION_PATTERN.match?(version.to_s)
end