Module: Tins::StringVersion
- Defined in:
- lib/tins/string_version.rb
Overview
Provides version string parsing and comparison functionality.
This module allows working with semantic version strings in a more intuitive way, supporting operations like comparison, incrementing, and accessing individual components.
Defined Under Namespace
Classes: Version
Constant Summary collapse
- LEVELS =
Map of version level symbols to their numeric indices
[ :major, :minor, :build, :revision ].each_with_index. each_with_object({}) { |(k, v), h| h[k] = v }.freeze
- SYMBOLS =
Inverted map of LEVELS for symbol lookup
LEVELS.invert.freeze
Class Method Summary collapse
-
.compare(version1, operator, version2) ⇒ Boolean
Compares two version strings using the specified operator.
Instance Method Summary collapse
-
#version ⇒ Tins::StringVersion::Version
Creates a Version object from this string.
Class Method Details
Instance Method Details
#version ⇒ Tins::StringVersion::Version
Creates a Version object from this string
259 260 261 |
# File 'lib/tins/string_version.rb', line 259 def version Version.new(self) end |