From: Fujimoto H. <hi...@fo...> - 2007-07-15 23:41:33
|
YOURAPP/Contents/MacOS/YOURAPP is almost same as the ruby command. e.g. $ /Applications/TMPresents.app/Contents/MacOS/TMPresents --version ruby 1.8.2 (2004-12-25) [universal-darwin8.0] TMPresents.app is a RubyCocoa app. main.m of a typical RubyCocoa app is: int main(int argc, const char *argv[]) { return RBApplicationMain("rb_main.rb", argc, argv); } RBApplicationMain is a traditional API. And RBApplicationInit is an alternative modern API: int main(int argc, const char *argv[]) { RBApplicationInit("rb_main.rb", argc, argv, nil); return NSApplicationMain(argc, argv); } rb_main.rb: require 'osx/cocoa' OSX.init_for_bundle do |bdl, param, log| # param - the 4th argument of RBApplicationInit as optional data # log - nslog wrapper for this block # initialize/loadin your ruby programs here. log.info("bdl=%p, param=%p", bdl, param) require 'your_ruby_programs' ... end end -- hisa On 7/16/07, Tim Perrett <he...@ti...> wrote: > rb_main.rb doesnt have a shebang line so I dont think that would > work? Having said that if it doesnt have a shebang line how does RC > know where the ruby bin is? Or is that somehow embedded inside the > framework when it is built? > > Tim > > > > On 15 Jul 2007, at 21:21, Rupert BARROW wrote: > > > I should think : just change the '#! /usr/bin/env ruby' in > > rb_main.rb to point to the packaged ruby in your app, no ? > > > > Rup > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > -- hisa |