Ruby support #1
2 changed files with 3 additions and 3 deletions
|
|
@ -34,7 +34,7 @@ fn call_lua_on_update_from_rust(
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.0;
|
.0;
|
||||||
scripting_runtime.with_engine(|ruby| {
|
scripting_runtime.with_engine(|ruby| {
|
||||||
let val: i32 = TryConvert::try_convert(val.get_inner_with(&ruby)).unwrap();
|
let val: i32 = TryConvert::try_convert(val.get_inner_with(ruby)).unwrap();
|
||||||
println!("script returned: {}", val);
|
println!("script returned: {}", val);
|
||||||
});
|
});
|
||||||
exit.write(AppExit::Success);
|
exit.write(AppExit::Success);
|
||||||
|
|
|
||||||
|
|
@ -431,7 +431,7 @@ impl Runtime for RubyRuntime {
|
||||||
|
|
||||||
self.execute_in_thread(Box::new(move |ruby: &Ruby| {
|
self.execute_in_thread(Box::new(move |ruby: &Ruby| {
|
||||||
ruby.define_global_function(&name, function!(callback, -1));
|
ruby.define_global_function(&name, function!(callback, -1));
|
||||||
RubyValue::nil(&ruby)
|
RubyValue::nil(ruby)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
@ -456,7 +456,7 @@ impl Runtime for RubyRuntime {
|
||||||
var.ivar_set("_current", BevyEntity(entity)).unwrap();
|
var.ivar_set("_current", BevyEntity(entity)).unwrap();
|
||||||
|
|
||||||
let args: Vec<_> = args
|
let args: Vec<_> = args
|
||||||
.parse(&ruby)
|
.parse(ruby)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|a| ruby.get_inner(a.0))
|
.map(|a| ruby.get_inner(a.0))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue