rosy 0.0.2

Ruby bindings for Rust.
Documentation

Rosy

Build status Lines of code crates.io downloads docs.rs

High-level bindings of Ruby's C API for Rust.

Installation

This crate is available on crates.io and can be used by adding the following to your project's Cargo.toml:

[dependencies]
rosy = "0.0.2"

Rosy has functionality that is only available for certain Ruby versions. The following features can currently be enabled:

  • ruby_2_6

For example:

[dependencies.rosy]
version = "0.0.2"
features = ["ruby_2_6"]

Finally add this to your crate root (main.rs or lib.rs):

extern crate rosy;

Usage

Rosy allows you to perform many operations over Ruby objects in a way that feels very natural in Rust.

use rosy::String;

// The VM should be initialized before doing anything
rosy::vm::init().expect("Could not initialize Ruby");

let string = String::from("hello\r\n");
string.call("chomp!").unwrap();

assert_eq!(string, "hello");

License

This project is released under either:

at your choosing.