ref: b961e7a81c5302d4af740f7f18559eae48ccddd9 rust-ruby-wrap-data/README.md -rw-r--r-- 627 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Ruby Wrap Data

`ruby_wrap_data` is a Rust crate that provides a fairly low-level means of doing
what Ruby's `Data_Wrap_Struct` macro does. That is to say, you can store a Rust
`Box<T>` inside a Ruby object and get it back out again.

Any heap-allocated struct, enum, or whatever should work.

## Testing

Assuming you're using rbenv (if not, sorry, you're on your own):

```
CONFIGURE_OPTS=--enable-shared rbenv install
RUBY=$(rbenv which ruby) cargo test
```

You may need to help Rust find the libruby.so file, like this:

```
export LD_LIBRARY_PATH=$HOME/.rbenv/versions/2.5.1/lib
RUBY=$(rbenv which ruby) cargo test
```