Crates.io | flex-version |
lib.rs | flex-version |
version | 0.3.0 |
source | src |
created_at | 2021-12-21 19:26:31.874523 |
updated_at | 2022-02-07 15:08:43.029413 |
description | A crate for flexible version numbers, mostly inspired by Ruby's Gem::Version |
homepage | |
repository | https://github.com/cloudwalk/flex-version |
max_upload_size | |
id | 501300 |
size | 14,271 |
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.
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 |
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.
The following versions are ordered from lower to higher. Equal versions are presented in the same line.
0.9
1.0.a.2
1.0.b1
1.0
, 1
, 1.0.0.0
1.0.1