2 unstable releases
0.2.0 | Oct 23, 2021 |
---|---|
0.1.0 | Jan 7, 2020 |
#2742 in Parser implementations
18KB
331 lines
CronVer
Chronologic versioning (see https://chronver.org) is a set of rules for assigning version numbers.
Installation
To use chronver
, add it to your Cargo.toml
:
[dependencies]
chronver = "0.2.0"
License
This project is licensed under MIT License (or http://opensource.org/licenses/MIT).
lib.rs
:
Chronologic version parsing.
Chronologic versioning (see https://chronver.org) is a set of rules for assigning version numbers.
ChronVer overview
Given a version number YEAR.MONTH.DAY.CHANGESET_IDENTIFIER, increment the:
- YEAR version when the year changes,
- MONTH version when the month changes,
- DAY version when the day changes, and the
- CHANGESET_IDENTIFIER everytime you commit a change to your package/project.
Versions
A simple Version
can be constructed by using the parse
method:
use chronver::Version;
use time::macros::date;
assert!(Version::parse("2020.01.06") == Ok(Version {
date: date!(2020-01-06),
changeset: 0,
label: None,
}));
Versions can also be compared with each other:
use chronver::Version;
assert_ne!(
Version::parse("2020.01.06-alpha").unwrap(),
Version::parse("2020.01.06-beta").unwrap()
);
Dependencies
~1–1.6MB
~32K SLoC