magnus 0.8.2

High level Ruby bindings. Write Ruby extension gems in Rust, or call Ruby code from a Rust binary.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
fn hello(subject: String) -> String {
    format!("hello, {}", subject)
}

fn main() {
    magnus::Ruby::init(|ruby| {
        ruby.define_global_function("hello", magnus::function!(hello, 1));

        ruby.eval::<magnus::value::Qnil>(r#"puts hello("world")"#)
            .unwrap();

        Ok(())
    })
    .unwrap()
}