A utility for comparing semantic version numbers (see: http://semver.org).
Initialize a new SemanticVersion object with SemanticVersion[] or SemanticVersion.new().
SemanticVersion objects may be compared against strings or other SemanticVersion objects using standard operators: ==, >, >=, <, <=.
SemanticVersion objects also have an is method for comparing against strings or other SemanticVersion objects.
Available operators for use with the is method:
eqorequal_toreturns true if versions are equivalent; false otherwiseltorless_thanreturns true if SemanticVersion is less than comparison version; false otherwiselteorless_than_or_equal_toreturns true if SemanticVersion is less than or equal to comparison version; false otherwisegtorgreater_thanreturns true if SemanticVersion is greater than comparison version; false otherwisegteorgreater_than_or_equal_toreturns true if SemanticVersion is greater than or equal to comparison version; false otherwisebetweenreturns true if SemanticVersion falls between two comparison versions; false otherwisewithinreturns true if SemanticVersion falls within the range of two comparison versions (inclusive); false otherwiseany_ofreturns true if SemanticVersion is equivalent to any of the versions in a list; false otherwise
Examples:
version_a = SemanticVersion["1.0"]
version_b = SemanticVersion["2.0"]
version_a < version_b #=> true
SemanticVersion["2.5.0"] == "2.5" #=> true
SemanticVersion["2.5.0"] > "2.5.0-beta" #=> true
SemanticVersion["3.2.0-beta"].is gt: "3.2.0-alpha", lt: "3.2.0-rc" #=> true
SemanticVersion["5.6.2"].is between: ["5.6.0", "5.6.4"] #=> true
SemanticVersion["2.2.48"].is any_of: ["2.2.2", "2.2.48", "3.8.0"] #=> true
SemanticVersion["1.0.0-rc+1234"] == "1.0.0-rc+6789" #=> true- Tests