Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Denarius

macrumors 6502a
Original poster
Feb 5, 2008
690
0
Gironde, France
Hi folks,

I was just looking through XCode and saw the options for creating Aqua RubyCocoa apps, which is something I will need to do on my current project, but part of it is a command line utility that it would be very useful to compile if possible as the utility uses a couple of extra ruby gems and it would be nice to bypass the gem dependency by compiling it. What say you?

Cheers.
 

larkost

macrumors 6502a
Oct 13, 2007
534
1
Ruby (and Python and Perl) "Cocoa" apps don't really compile the Ruby (/Python/Perl) portions, but rather just compile the Obj-C portion that runs the scripts as-is. I think it would be possible to put the gems within the .app bundle (and therefore take them with it), but there is no easy way to make everything into a single file.

You might be able to strip all of the GUI elements out of the app and run it from a command line, but you are going to have override a few of NSApps methods to do so.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
You might want to expand what you need to do, and why you need the bridge to Cocoa to do it. There may already be gems to do it "natively", etc. so you don't need the bridge at all.

-Lee
 

Denarius

macrumors 6502a
Original poster
Feb 5, 2008
690
0
Gironde, France
Ah right, thank you for clarifying what RubyCocoa actually does. Bundling the gems in sounds like a great idea. Stripping all the interface elements from a RubyCocoa app does seem a bit pointless if it isn't compiling. :) It appears I am guilty of getting the wrong end of the stick.

There will also be a preference pane to do as well as the command line utility. Presumably RubyCocoa is a good solution for this part (given that I have no obj-c experience whatsoever)?

Thank you again.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.