Hi,
I think RBBundleInit() is suited for your purpose.
The interface of RBBundleInit is like this.
// <RubyCocoa/RBRuntime.h>
int RBBundleInit (const char* path_to_ruby_program,
Class objc_class,
id additional_param);
- path_to_ruby_program:
path of ruby script in the bundle. e.g. "main.rb".
RubyCocoa expects the path as related path from Resources/.
- objc_class:
an ObjC class to specify your bundle. e.g. AppDelegate.
- additional_param:
you can pass nil.
On Sat, 22 Mar 2008 22:32:19 -0700, Scott Thompson wrote:
> On Mac OS X (Leopard), I'm trying to embed Ruby into an Objective-C
> application (as opposed to writing a Cocoa application in Ruby).
> I've got it working, but I was curious about one aspect.
>
> To initialize Ruby, I'm calling RBApplicationInit to initialize
> Ruby. I know how to get at the argc and argv parameters, but the
> last parameter, the "id" valued parameter... how is that passed to
> the Ruby script named in the first parameter of RBApplicationInit?
>
> Scott
|