From: Jon B. <jo...@gm...> - 2007-07-16 02:50:23
|
I just "rubycocoa new TestApp", build + get this: [MacBook-Pro:~/TestApp/build/Release/TestApp.app/Contents/MacOS]$ ./ TestApp --version ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.4] [MacBook-Pro:~/TestApp/build/Release/TestApp.app/Contents/MacOS]$ I think (?) the point behind a bundled Ruby w/ your RC app is to not have to need the end user to touch any files or need to set anything and use a shipping Ruby capable of running on both PPC/Intel. I just downloaded the one-click (http://rubyosx.rubyforge.org/) and extract using Pacifist to a /VM directory under my project, how can I get it to use that ruby instead of system ruby? - Jon On Jul 15, 2007, at 7:41 PM, Fujimoto Hisa wrote: > 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 > > ---------------------------------------------------------------------- > --- > 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 |