ec_semver
Helper functions for working with semver versioning strings.
Helper functions for working with semver versioning strings. See http://semver.org/ for the spec.
DATA TYPES
alpha_info() = {PreRelease::[alpha_part()], BuildVersion::[alpha_part()]}
alpha_part() = integer() | binary() | string()
any_version() = version_string() | semver()
major_minor_patch_minpatch() = version_element() | {version_element(), version_element()} | {version_element(), version_element(), version_element()} | {version_element(), version_element(), version_element(), version_element()}
semver() = {major_minor_patch_minpatch(), alpha_info()}
version_element() = non_neg_integer() | binary()
version_string() = string() | binary()
Functions
parse(Version::any_version()) -> semver()
parse a string or binary into a valid semver representation
format(X1::semver()) -> iolist()
eql(VsnA::any_version(), VsnB::any_version()) -> boolean()
test for quality between semver versions
gt(VsnA::any_version(), VsnB::any_version()) -> boolean()
Test that VsnA is greater than VsnB
gte(VsnA::any_version(), VsnB::any_version()) -> boolean()
Test that VsnA is greater than or equal to VsnB
lt(VsnA::any_version(), VsnB::any_version()) -> boolean()
Test that VsnA is less than VsnB
lte(VsnA::any_version(), VsnB::any_version()) -> boolean()
Test that VsnA is less than or equal to VsnB
between(Vsn1::any_version(), Vsn2::any_version(), VsnMatch::any_version()) -> boolean()
Test that VsnMatch is greater than or equal to Vsn1 and less than or equal to Vsn2
pes(VsnA, VsnB) -> term()
check that VsnA is Approximately greater than VsnB
Specifying ">= 2.6.5" is an optimistic version constraint. All versions greater than the one specified, including major releases (e.g. 3.0.0) are allowed.
Conversely, specifying "~> 2.6" is pessimistic about future major revisions and "~> 2.6.5" is pessimistic about future minor revisions.
"~> 2.6" matches cookbooks >= 2.6.0 AND < 3.0.0 "~> 2.6.5" matches cookbooks >= 2.6.5 AND < 2.7.0
internal_parse_version(X1::iolist()) -> semver()
helper function for the peg grammer to parse the iolist into a semver