flex-version

Crates.ioflex-version
lib.rsflex-version
version0.3.0
sourcesrc
created_at2021-12-21 19:26:31.874523
updated_at2022-02-07 15:08:43.029413
descriptionA crate for flexible version numbers, mostly inspired by Ruby's Gem::Version
homepage
repositoryhttps://github.com/cloudwalk/flex-version
max_upload_size
id501300
size14,271
Caio Everest (everestcw)

documentation

README

Flex Version

Crates.io Crates.io License Contributors

A crate for flexible version numbers, mostly inspired by Ruby's Gem::Version. This crate provides a flexible versioning structure which is compatible with Semantic Versioning, and some other obscure versioning schemas used in the wild.

Syntax

Versions are defined as components separated by dots, minus or plus signs. Each component might be either a number, or an alphabetic string.

Version string Canonical representation
0 0
0.9 0.9
0.9a 0.9.a
0.9.a 0.9.a
1.0 1.0
1.0.5.4-b.3 1.0.5.4.b.3

Ordering

Versions have a total order, which is mainly determined by the order of numeric components. Alphabetic components are inferior to all numeric components, and lexicographic between themselves. When comparing Versions, missing trailing components are treated as zero.

Example

The following versions are ordered from lower to higher. Equal versions are presented in the same line.

  1. 0.9
  2. 1.0.a.2
  3. 1.0.b1
  4. 1.0, 1, 1.0.0.0
  5. 1.0.1
Commit count: 15

cargo fmt