GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing elixir.hexdocs.pm — Version — Elixir v1.20.5 Functions for parsing and matching versions against requirements. A version is a string in a specific format or a Although Elixir projects are not required to follow SemVer, they must follow the format outlined on SemVer 2.0 schema. VersionsIn a nutshell, a version is represented by three numbers: Each numeric component is limited to at most 14 digits. Pre-releases are supported by optionally appending a hyphen and a series of
period-separated identifiers immediately following the patch version.
Identifiers consist of only ASCII alphanumeric characters and hyphens ( Numeric pre-release identifiers are also limited to at most 14 digits. Build information can be added by appending a plus sign and a series of
dot-separated identifiers immediately following the patch or pre-release version.
Identifiers consist of only ASCII alphanumeric characters and hyphens ( RequirementsRequirements allow you to specify which versions of a given
dependency you are willing to work against. Requirements support the common
comparison operators such as You can skip the operator, which is equivalent to Requirements also support Since the example above is such a common requirement, it can be expressed as:
The requirement operand after the When the
SummaryFunctionsThe Version struct. Compares two versions. Compiles a requirement to an internal representation that may optimize matching. Checks if the given version matches the specification. Parses a version string into a Parses a version string into a Parses a version requirement string into a Parses a version requirement string into a Converts the given version to a string. Types@type build() :: String.t() | nil @type major() :: non_neg_integer() @type match_opts() :: [{:allow_pre, boolean()}] @type minor() :: non_neg_integer() @type patch() :: non_neg_integer() @type pre() :: [String.t() | non_neg_integer()] @type requirement() :: String.t() | Version.Requirement.t() FunctionsThe Version struct. It contains the fields You can read those fields but you should not create a new Compares two versions. Returns Pre-releases are strictly less than their corresponding release versions. Patch segments are compared lexicographically if they are alphanumeric, and numerically otherwise. Build segments are ignored: if two versions differ only in their build segment they are considered to be equal. Raises a Examples
@spec compile_requirement(Version.Requirement.t()) :: Version.Requirement.t() Compiles a requirement to an internal representation that may optimize matching. The internal representation is opaque. @spec match?(version(), requirement(), match_opts()) :: boolean() Checks if the given version matches the specification. Returns Options
Examples
Parses a version string into a Examples
Parses a version string into a If Examples
@spec parse_requirement(String.t()) :: {:ok, Version.Requirement.t()} | :error Parses a version requirement string into a Examples
@spec parse_requirement!(String.t()) :: Version.Requirement.t() Parses a version requirement string into a If Examples
Converts the given version to a string. Examples
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |