verl (verl v1.1.0) View Source

Link to this section Summary

Functions

Helper function that returns true if the first version is greater than the third version and also the second version is less than the the third version, otherwise returns false. See compare/2 for more details.
Compares two versions, returning whether the first argument is greater, equal, or less than the second argument.
Compiles a version requirement as returned by parse_requirement for faster matches.
Helper function that returns true if two versions are equal, otherwise false. See compare/2 for more details.
Helper function that returns true the first version given is greater than the second, otherwise returns false. See compare/2 for more details.
Helper function that returns true the first version given is greater than or equal to the second, otherwise returns false. See compare/2 for more details.
Returns true if the dependency is in range of the requirement, otherwise false, or an error.
Works like is_match/2 but takes extra options as an argument.
Helper function that returns true the first version given is less than the second, otherwise returns false. See compare/2 for more details.
Helper function that returns true the first version given is less than or equal to the second, otherwise returns false. See compare/2 for more details.
Parses a semantic version, returning {ok, version_t()} or {error, invalid_version}
Parses a semantic version requirement, returning {ok, requirement_t()} or {error, invalid_requirement}

Link to this section Types

Specs

build() :: binary() | :undefined
Link to this type

compiled_requirement/0

View Source

Specs

compiled_requirement() :: %{
  optional(:compiled) => true,
  optional(:matchspec) => :ets.comp_match_spec(),
  optional(:string) => requirement()
}

Specs

major() :: non_neg_integer()

Specs

match_opts() :: [:allow_pre | {:allow_pre, true}]

Specs

minor() :: non_neg_integer()

Specs

patch() :: non_neg_integer()

Specs

pre() :: [binary() | non_neg_integer()]

Specs

requirement() :: binary()

Specs

requirement_t() :: %{
  optional(:string) => requirement(),
  optional(:matchspec) => list(),
  optional(:compiled) => boolean()
}

Specs

version() :: binary()

Specs

version_t() :: %{
  optional(:major) => major(),
  optional(:minor) => minor(),
  optional(:patch) => patch(),
  optional(:pre) => pre(),
  optional(:build) => build()
}

Link to this section Functions

Link to this function

between(Vsn1, Vsn2, VsnMatch)

View Source

Specs

between(version(), version(), version()) ::
  boolean() | {:error, :invalid_version}
Helper function that returns true if the first version is greater than the third version and also the second version is less than the the third version, otherwise returns false. See compare/2 for more details.
Link to this function

compare(Version1, Version2)

View Source

Specs

compare(version(), version()) :: :gt | :eq | :lt | {:error, :invalid_version}
Compares two versions, returning whether the first argument is greater, equal, or less than the second argument.
Link to this function

compile_requirement(Req)

View Source

Specs

compile_requirement(requirement_t()) :: compiled_requirement()
Compiles a version requirement as returned by parse_requirement for faster matches.

Specs

eq(version(), version()) :: boolean() | {:error, :invalid_version}
Helper function that returns true if two versions are equal, otherwise false. See compare/2 for more details.

Specs

gt(version(), version()) :: boolean() | {:error, :invalid_version}
Helper function that returns true the first version given is greater than the second, otherwise returns false. See compare/2 for more details.

Specs

gte(version(), version()) :: boolean() | {:error, :invalid_version}
Helper function that returns true the first version given is greater than or equal to the second, otherwise returns false. See compare/2 for more details.
Link to this function

is_match(Version, Requirement)

View Source

Specs

is_match(version() | version_t(), requirement() | requirement_t()) ::
  boolean() | {:error, :badarg | :invalid_requirement | :invalid_version}
Returns true if the dependency is in range of the requirement, otherwise false, or an error.
Link to this function

is_match(Version, Requirement, Opts)

View Source

Specs

is_match(version() | version_t(), requirement() | requirement_t(), match_opts()) ::
  boolean() | {:error, :badarg | :invalid_requirement | :invalid_version}
Works like is_match/2 but takes extra options as an argument.

Specs

lt(version(), version()) :: boolean() | {:error, :invalid_version}
Helper function that returns true the first version given is less than the second, otherwise returns false. See compare/2 for more details.

Specs

lte(version(), version()) :: boolean() | {:error, :invalid_version}
Helper function that returns true the first version given is less than or equal to the second, otherwise returns false. See compare/2 for more details.

Specs

parse(version()) :: {:ok, version_t()} | {:error, :invalid_version}
Parses a semantic version, returning {ok, version_t()} or {error, invalid_version}

Specs

parse_requirement(requirement()) ::
  {:ok, requirement_t()} | {:error, :invalid_requirement}
Parses a semantic version requirement, returning {ok, requirement_t()} or {error, invalid_requirement}
Link to this function

to_matchable(String, AllowPre)

View Source