#ruby #version #comparison #gem #buildpack #heroku #logic

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

#333 in Math

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.9–4.5MB
~82K SLoC