hacks/inline |
module Inline |
Constants |
CONFIG | |
---|---|
CFLAGS | |
LDFLAGS | |
CC |
Public Methods |
A helper function for checking dependencies. Calls the block if the target is out of date.
Put inline code in another language inside a Ruby script.
TODO: For now, you must have an Init_filename function in your C code, where filename is the name of your Ruby script (minus the .rb extension). This function could be automatically generated in the future.
TODO: Currently, this just checks dates to see if the Ruby file has been modified, and if so, it recompiles. Ideally, MD5 or some other mechanism should be used to see if the inline source has changed, so that the Ruby script can be modified without recompiling (I'm told that this is what the Perl inline module does).
TODO: CFLAGS and LDFLAGS should be configurable.
E.g.:
Inline.inline "C", <<END #include <stdio.h>void Init_inline_helper() { printf("hello, world!\n"); }
END
Inline::require
lang | The language of the source (currently must be "C") |
---|---|
source | The source to inline |
Explicitly build the _helper.so file from the source. You do not normally need to call this method.
lang | the language of the source |
---|
Automatically require the _helper.so file.
Clean the _helper.c and _helper.so files
For internal use only.