#ruby #version #comparison #gem #heroku #buildpack #ecosystem

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

#705 in Math

Download history 7/week @ 2024-10-08 16/week @ 2024-10-15 8/week @ 2024-10-29 1/week @ 2024-11-05 10/week @ 2024-12-03 46/week @ 2024-12-10

152 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
~82K SLoC