diff --git a/assets/tests/ruby/rust_function_gets_called_from_script_with_multiple_params.rb b/assets/tests/ruby/rust_function_gets_called_from_script_with_multiple_params.rb new file mode 100644 index 0000000..026ad0b --- /dev/null +++ b/assets/tests/ruby/rust_function_gets_called_from_script_with_multiple_params.rb @@ -0,0 +1,3 @@ +def test_func + rust_func(5, "test") +end diff --git a/assets/tests/ruby/script_function_gets_called_from_rust_with_single_param.rb b/assets/tests/ruby/script_function_gets_called_from_rust_with_single_param.rb new file mode 100644 index 0000000..a71146d --- /dev/null +++ b/assets/tests/ruby/script_function_gets_called_from_rust_with_single_param.rb @@ -0,0 +1,7 @@ +STATE = { + "a_value" => nil +} + +def test_func(a) + STATE["a_value"] = a +end diff --git a/src/runtimes/ruby.rs b/src/runtimes/ruby.rs index b351463..f245579 100644 --- a/src/runtimes/ruby.rs +++ b/src/runtimes/ruby.rs @@ -4,6 +4,8 @@ // TODO: consider dropping magnus // TODO: unwinding https://doc.rust-lang.org/nomicon/ffi.html#variadic-functions // TODO: maybe unify api and call non thread methods non_send +// TODO: use ruby arena to rewind state + use std::{ collections::HashMap, ffi::{c_void, CString},