Ruby support #1
2 changed files with 4 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
def test_func
|
def test_func
|
||||||
rust_func.and_then lambda { |x|
|
rust_func.and_then lambda { |x|
|
||||||
$state['x'] = x
|
print('abc' + 5)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -368,7 +368,9 @@ impl Runtime for RubyRuntime {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|x| ruby.get_inner(x.0).as_value())
|
.map(|x| ruby.get_inner(x.0).as_value())
|
||||||
.collect();
|
.collect();
|
||||||
let result: magnus::Value = f.funcall("call", args.as_slice()).unwrap();
|
let result: magnus::Value = f.funcall("call", args.as_slice()).map_err(|e| {
|
||||||
|
ScriptingError::RuntimeError(Box::new(io::Error::other(e.to_string())))
|
||||||
|
})?;
|
||||||
Ok(RubyValue::new(result))
|
Ok(RubyValue::new(result))
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue