#ruby #version #comparison #gem #heroku #buildpack #case

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

#719 in Math

Download history 9/week @ 2024-11-30 45/week @ 2024-12-07 2/week @ 2024-12-14 153/week @ 2025-03-01

153 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.7–4.5MB
~80K SLoC