diff --git a/README.md b/README.md index 4e966b3..1b73d77 100644 --- a/README.md +++ b/README.md @@ -82,10 +82,3 @@ hello hello world => nil ``` - -To run all tests in the repository, run - -```shell -rake install -rake -``` diff --git a/ruby/lib/helix_runtime/project.rb b/ruby/lib/helix_runtime/project.rb index 1826f5a..f0f0eb2 100644 --- a/ruby/lib/helix_runtime/project.rb +++ b/ruby/lib/helix_runtime/project.rb @@ -100,9 +100,6 @@ module HelixRuntime if ENV['VERBOSE'] cargo_args << " --verbose" end - if ENV['CARGO_EXTRA_ARGS'] - cargo_args << ENV['CARGO_EXTRA_ARGS'] - end if link_args rustc_args << "-C link-args=#{link_args}" end diff --git a/src/coercions/mod.rs b/src/coercions/mod.rs index f4c2bed..6926414 100644 --- a/src/coercions/mod.rs +++ b/src/coercions/mod.rs @@ -49,7 +49,3 @@ pub type ToRubyResult = Result; pub trait ToRuby { fn to_ruby(self) -> ToRubyResult; } - -pub trait InitRuby { - fn init_ruby(); -} \ No newline at end of file diff --git a/src/macros/codegen.rs b/src/macros/codegen.rs index 72c595b..5bf0933 100644 --- a/src/macros/codegen.rs +++ b/src/macros/codegen.rs @@ -222,44 +222,10 @@ macro_rules! codegen_method { }; } -#[macro_export] -macro_rules! codegen_ruby_init { - ({ - type: class, - rust_name: $rust_name:tt, - ruby_name: $ruby_name:tt, - meta: { pub: $pub:tt, reopen: $reopen:tt }, - struct: $struct:tt, - methods: $methods:tt - }) => ( - impl $crate::InitRuby for $rust_name { - fn init_ruby() { - codegen_class_binding!({ - type: class, - rust_name: $rust_name, - ruby_name: $ruby_name, - meta: { pub: $pub, reopen: $reopen }, - struct: $struct, - methods: $methods - }, { - type: class, - rust_name: $rust_name, - ruby_name: $ruby_name, - meta: { pub: $pub, reopen: $reopen }, - struct: $struct, - methods: $methods - }); - } - } - ); -} - - #[macro_export] macro_rules! codegen_extra_impls { ($class:tt) => ( codegen_allocator!($class); codegen_coercions!($class); - codegen_ruby_init!($class); ) -} \ No newline at end of file +} diff --git a/src/macros/init.rs b/src/macros/init.rs index d9bb88f..2db9ada 100644 --- a/src/macros/init.rs +++ b/src/macros/init.rs @@ -1,32 +1,18 @@ #[macro_export] macro_rules! codegen_init { - // Extracts the list of rust class names and calls the actual codegen_init with that - { [ $({ - type: class, - rust_name: $rust_name:tt, - ruby_name: { $($ruby_name:tt) * }, - meta: { pub: $pub:tt, reopen: $reopen:tt }, - struct: $struct:tt, - methods: [ $($method:tt) * ] - })* ] } => ( - codegen_init!{ [ $($rust_name)* ] } - ); - - { [ $($rust_name:tt)* ] } => { + { [ $($class:tt)* ] } => { #[allow(non_snake_case)] #[no_mangle] pub extern "C" fn Init_native() { - use $crate::InitRuby; $crate::sys::check_version(); $( - $rust_name::init_ruby(); + codegen_class_binding!($class, $class); )* } - }; + } } - #[macro_export] macro_rules! codegen_class_binding { { $class:tt, {