#heroku

gem_version

Ruby's Gem::Version comparison logic in Rust

5 unstable releases

0.3.1 Jul 24, 2024
0.3.0 Jul 24, 2024
0.2.0 Jul 19, 2024
0.1.1 Jul 19, 2024
0.1.0 Jul 19, 2024

#2 in #heroku

49 downloads per month

MIT license

11KB
216 lines

Gem version

What

Implement Ruby's Gem::Version comparison logic in Rust:

The main use case is for the Heroku Ruby buildpack https://github.com/heroku/buildpacks-ruby and associated ecosystem of managing Ruby logic inside of Rust.

Install

Add it to your cargo.toml:

$ cargo add gem_version

Use

use std::str::FromStr;
use gem_version::GemVersion;

let version = GemVersion::from_str("1.0.0").unwrap();
assert!(version < GemVersion::from_str("2.0.0").unwrap());

Dependencies

~2.8–4.5MB
~83K SLoC