module Versionomy::Format::Semver::ExtraMethods
Extra methods added to version values that use the semver schema.
Public Instance Methods
compatible_with?(version_)
click to toggle source
Returns true if this version is compatible with the given version, according to the Semantic Versioning specification. For example, 1.1.0 is compatible with 1.0.0 but not vice versa, 1.1.1 and 1.1.0 are compatible with each other, while 1.0.0 and 2.0.0 are mutually incompatible.
# File lib/versionomy/format_definitions/semver.rb, line 90 def compatible_with?(version_) self.major == version_.major ? self.minor >= version_.minor : false end
prerelease?()
click to toggle source
Returns true if the version is a prerelease version– that is, if the prerelease_suffix is nonempty.
# File lib/versionomy/format_definitions/semver.rb, line 70 def prerelease? prerelease_suffix.length > 0 end
release()
click to toggle source
Returns the release for this version. For example, converts “1.2.0a1” to “1.2.0”. Non-prerelease versions return themselves unchanged.
# File lib/versionomy/format_definitions/semver.rb, line 79 def release prerelease? ? self.change(:prerelease_suffix => '') : self end