magnus 0.7.1

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
use magnus::Value;

#[test]
fn it_formats_with_to_s() {
    let ruby = unsafe { magnus::embed::init() };

    let val = ruby
        .eval::<Value>(r#"["foo".upcase, "bar".to_sym, 1 + 2]"#)
        .unwrap();

    assert_eq!(r#"["FOO", :bar, 3]"#, format!("{:?}", val));
}