#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

#695 in Math

Download history 1/week @ 2024-09-30 2/week @ 2024-10-07 22/week @ 2024-10-14 7/week @ 2024-10-28 2/week @ 2024-11-04 9/week @ 2024-12-02 45/week @ 2024-12-09 2/week @ 2024-12-16

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