Module rabbit_semver

Helper functions for working with semver versioning strings.

Copyright © (C) 2011, Erlware LLC

Description

Helper functions for working with semver versioning strings. See https://semver.org/ for the spec.

Data Types

alpha_info()

alpha_info() = {PreRelease::[alpha_part()], BuildVersion::[alpha_part()]}

alpha_part()

alpha_part() = integer() | binary() | string()

any_version()

any_version() = version_string() | semver()

major_minor_patch_minpatch()

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()

semver() = {major_minor_patch_minpatch(), alpha_info()}

version_element()

version_element() = non_neg_integer() | binary()

version_string()

version_string() = string() | binary()

Function Index

between/3Test that VsnMatch is greater than or equal to Vsn1 and less than or equal to Vsn2.
eql/2test for quality between semver versions.
format/1
gt/2Test that VsnA is greater than VsnB.
gte/2Test that VsnA is greater than or equal to VsnB.
internal_parse_version/1helper function for the peg grammar to parse the iolist into a semver.
lt/2Test that VsnA is less than VsnB.
lte/2Test that VsnA is less than or equal to VsnB.
normalize/1normalize the semver so they can be compared.
parse/1parse a string or binary into a valid semver representation.
pes/2check that VsnA is Approximately greater than VsnB.

Function Details

between/3

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

eql/2

eql(VsnA::any_version(), VsnB::any_version()) -> boolean()

test for quality between semver versions

format/1

format(X1::semver()) -> iolist()

gt/2

gt(VsnA::any_version(), VsnB::any_version()) -> boolean()

Test that VsnA is greater than VsnB

gte/2

gte(VsnA::any_version(), VsnB::any_version()) -> boolean()

Test that VsnA is greater than or equal to VsnB

internal_parse_version/1

internal_parse_version(X1::iolist()) -> semver()

helper function for the peg grammar to parse the iolist into a semver

lt/2

lt(VsnA::any_version(), VsnB::any_version()) -> boolean()

Test that VsnA is less than VsnB

lte/2

lte(VsnA::any_version(), VsnB::any_version()) -> boolean()

Test that VsnA is less than or equal to VsnB

normalize/1

normalize(Other::semver()) -> semver()

normalize the semver so they can be compared

parse/1

parse(Version::any_version()) -> semver()

parse a string or binary into a valid semver representation

pes/2

pes(VsnA, VsnB) -> any()

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


Generated by EDoc