Fixes for the the examples

This commit is contained in:
konstin 2018-04-08 18:07:04 +02:00
parent 6733f74b0d
commit f5840040ef
3 changed files with 15 additions and 8 deletions

View File

@ -82,3 +82,10 @@ hello
hello world
=> nil
```
To run all tests in the repository, run
```shell
rake install
rake
```

View File

@ -219,7 +219,7 @@ macro_rules! codegen_ruby_init {
rust_name: $rust_name:tt,
ruby_name: $ruby_name:tt,
meta: { pub: $pub:tt, reopen: $reopen:tt },
struct: (),
struct: $struct:tt,
methods: $methods:tt
}) => (
impl $crate::InitRuby for $rust_name {
@ -229,14 +229,14 @@ macro_rules! codegen_ruby_init {
rust_name: $rust_name,
ruby_name: $ruby_name,
meta: { pub: $pub, reopen: $reopen },
struct: (),
struct: $struct,
methods: $methods
}, {
type: class,
rust_name: $rust_name,
ruby_name: $ruby_name,
meta: { pub: $pub, reopen: $reopen },
struct: (),
struct: $struct,
methods: $methods
});
}

View File

@ -3,11 +3,11 @@ 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: false },
struct: (),
methods: [ $ ( $ method: tt) * ]
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)* ] }
);