Hi,
I am trying to implement some macruby pre-initialisation inside an Objective-C class, to enhance the Objective-C class with some ruby methods before returning the initialized object to MacRuby. I was wondering if the + MacRuby sharedRuntime execution context is the same as my MacRuby application execution context? Right now, it does not seem like the sharedRuntime preparation I do inside my Objective-C initializer does affect my MacRuby execution:
in MacRuby:
framework "MyObjCFramework"
myObject = MyClass.enhancedInitializer
in Objective-C:
// MyObjCFramework
...
+ (id)enhancedInitializer
{
id myInstance = [MyClass regularInitializer];
NSBundle * fbundle = [NSBundle bundleForClass:[MyClass class]];
NSString * rbPath = [fbundle pathForResource:@"myClass_ruby" ofType:@"rb"];
[[MacRuby sharedRuntime] evaluateFileAtPath:rbPath];
return myInstance;
}
Is something like this supposed to be possible?
Thanks!
L-P