Class: Dependabot::Utils::Rust::Version
- Inherits:
-
Gem::Version
- Object
- Gem::Version
- Dependabot::Utils::Rust::Version
- Defined in:
- lib/dependabot/utils/rust/version.rb
Constant Summary collapse
- VERSION_PATTERN =
'[0-9]+[0-9a-zA-Z]*(?>\.[0-9a-zA-Z]+)*' \ '(-[0-9A-Za-z-]+(\.[0-9a-zA-Z-]+)*)?' \ '(\+[0-9a-zA-Z]+(\.[0-9a-zA-Z]+)*)?'
- ANCHORED_VERSION_PATTERN =
/\A\s*(#{VERSION_PATTERN})?\s*\z/.freeze
Instance Method Summary collapse
-
#initialize(version) ⇒ Version
constructor
A new instance of Version.
-
#inspect ⇒ Object
:nodoc:.
- #to_s ⇒ Object
Constructor Details
#initialize(version) ⇒ Version
Returns a new instance of Version.
16 17 18 19 20 |
# File 'lib/dependabot/utils/rust/version.rb', line 16 def initialize(version) @version_string = version.to_s version, @build_version = version&.to_s&.split("+") super end |
Instance Method Details
#inspect ⇒ Object
:nodoc:
26 27 28 |
# File 'lib/dependabot/utils/rust/version.rb', line 26 def inspect # :nodoc: "#<#{self.class} #{@version_string}>" end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/dependabot/utils/rust/version.rb', line 22 def to_s @version_string end |