On Apr 20, 2009, at Apr 20, 1:32 PM, Laurent Sansonetti wrote:

This is the right way to do it. The "Embed MacRuby" target configures the linking settings of your app but you still need to hack the load path in rb_main.rb to point it to the MacRuby stdlib.

Here is another way:

$:.map! { |x| x.sub(/^\/Library\/Frameworks/, NSBundle.mainBundle.privateFrameworksPath) }
$:.unshift NSBundle.mainBundle.resourcePath.fileSystemRepresentation

I wasn't able to perform this change automatically during the target build. Maybe we could ship a new rb_main.rb in the template that does this change based on a heuristic... if you have any idea let me know.

Thanks for the response Laurent. I wonder if there wouldn't be some way to have the "Embed MacRuby" target generate an additional file that would modify the load path in that way. Then it could just be an additional ruby file that gets automatically required by the default rb_main.rb. There would obviously be a problem of ensuring the load- order so we could always do it with a conditional require. Hmmm...maybe that's kind of hacky too. :-P

Cheers,

Alex

----
Musings & Notes
http://blog.livollmers.net



_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to