On 4/25/14, 5:26 PM, Kevin Walzer wrote:
> Is what I'm trying to do possible, or is it a fool's errand? If this can
> be done, can anyone point me in the right direction about how to
> structure my C code?

Turns out this code seems to work well:

#include <ruby/ruby.h>


int main()
{
   ruby_init();

   char* file = "/Users/kevin/Desktop/test.rb";

   ruby_init_loadpath();

   ruby_script(file);

   char* options[] = { "", file, };

   void*  node    =  ruby_options( 2, options );

   return ruby_run_node( node );

}

Thanks to the responders at https://www.ruby-forum.com/topic/215431 for 
showing the way here. This code launches my Ruby-Tk code very nicely and 
does so with an embedded interpreter, rather than launching a separate 
Ruby process. This will make deploying a Ruby-Tk app on the Mac much 
simpler.

--Kevin


-- 
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com