[MacRuby-devel] integrating macruby into cocoa apps

Benjamin Stiglitz ben at tanjero.com
Tue Mar 18 14:42:00 PDT 2008


> I downloaded the early release of MacRuby hoping to integrate it into
> an existing cocoa application: I need to be able to run small amounts
> of user-supplied code to do custom string manipulations, and I thought
> MacRuby might be perfect for this.  However, I don't see any obvious
> way to hand off an NSString with code and have it execute in some
> environment.  Does such an API exist?  The only entry point I saw was
> macruby_main(), which doesn't seem quite right, or ruby_exec_node()
> which looks pretty low-level.  I realize that MacRuby is still in an
> early state, but I just wanted to be sure I wasn't overlooking
> something before I dug too much deeper.

Once string is hooked up, I suppose you could do [RbKernel eval:@"…"]

-Ben


More information about the MacRuby-devel mailing list