~tim/rust-ruby-wrap-data

f1e2db05a29cfb1beedb2c064f36a1f083f12bcd — Tim Morgan 2 years ago fe179ed
Build readme from crate docs
2 files changed, 32 insertions(+), 1 deletions(-)

A Makefile
M src/lib.rs
A Makefile => Makefile +8 -0
@@ 0,0 1,8 @@
build:
	cargo build

test:
	cargo test

readme:
	cargo readme > README.md

M src/lib.rs => src/lib.rs +24 -1
@@ 2,7 2,7 @@
//!
//! `ruby_wrap_data` is a 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.
//! pointer to a Rust `Box<T>` inside a Ruby object and get it back out again.
//!
//! Any heap-allocated struct, enum, or whatever should work.
//!


@@ 61,6 61,29 @@
//!     ruby_wrap_data::set(thing, new_data);
//! }
//! ```
//!
//! ## Testing
//!
//! Assuming you're using rbenv (if not, sorry, you're on your own):
//!
//! ```bash
//! 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:
//!
//! ```bash
//! export LD_LIBRARY_PATH=$HOME/.rbenv/versions/2.5.1/lib
//! RUBY=$(rbenv which ruby) cargo test
//! ```
//!
//! ## Copyright and License
//!
//! Copyright Tim Morgan
//!
//! Licensed MIT

extern crate ruby_sys;

use ruby_sys::types::{c_void, CallbackPtr, RBasic, Value};