Lennon Day-Reynolds wrote:
> What *I* really want is just a quick way to statically link a set of
> extensions into a custom Ruby interpreter. Ideally, it would also
> include an arbitrary chunk of Ruby code (either as a node tree, or
> just a constant C string) to be evaluated at startup. I don't need
> obfuscation, just convenient packaging.

Don't know whether this qualifies as quick, but why not just put your 
extension in ext/ and build it statically? You have to edit ext/Setup to 
refer to your extension, so that the build process knows you want to 
build it statically. For details, grep for Setup in README.EXT.

For QNX, I've ended up doing this for all extensions I use, both stdlib 
and otherwise, because ruby on QNX seems to have trouble loading 
dynamically.

But in any case, it has the effect of creating a custom ruby interpreter 
with your libraries (well, the .so part anyway) built in. You still have 
to load lib/ stuff separately, of course, so this may not help you.

I guess you could write a C extension that contains a huge string, which 
has all your ruby code, and just evals that string at startup.