module SemanticCompare
Extended Modules
Defined in:
semantic_compare.crInstance Method Summary
-
#complex_expression(semantic_version : SemanticVersion, expression : String) : Bool
Returns true if a version matches the complex expression, which can include "or"
||
signs. -
#simple_expression(semantic_version : SemanticVersion, expression : String) : Bool
Returns true if a version matches the simple expression.
Instance Method Detail
def complex_expression(semantic_version : SemanticVersion, expression : String) : Bool
#
Returns true if a version matches the complex expression, which can include "or" ||
signs.
semantic_version = SemanticVersion.parse "1.2.3"
SemanticCompare.complex_expression semantic_version, ">=1.0.4 || <2.0.0 || ~1.2.1" # => true
def simple_expression(semantic_version : SemanticVersion, expression : String) : Bool
#
Returns true if a version matches the simple expression.
semantic_version = SemanticVersion.parse "1.2.3"
SemanticCompare.simple_expression semantic_version, "<1.5.0" # => true
SemanticCompare.simple_expression semantic_version, "1.2.0 - 1.4.0" # => true