Class: Dependabot::Version

Inherits:
Gem::Version
  • Object
show all
Defined in:
lib/dependabot/version.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ Version

Returns a new instance of Version.



6
7
8
9
10
# File 'lib/dependabot/version.rb', line 6

def initialize(version)
  @original_version = version

  super
end

Class Method Details

.correct?(version) ⇒ Boolean

Opt-in to Rubygems 4 behavior

Returns:

  • (Boolean)


13
14
15
16
17
# File 'lib/dependabot/version.rb', line 13

def self.correct?(version)
  return false if version.nil?

  version.to_s.match?(ANCHORED_VERSION_PATTERN)
end

Instance Method Details

#to_semverObject



19
20
21
# File 'lib/dependabot/version.rb', line 19

def to_semver
  @original_version
end