module SemanticCompare

Extended Modules

Defined in:

semantic_compare.cr

Instance Method Summary

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

[View source]
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

[View source]