Rubycocoa compiled command line utility?

Discussion in 'Mac Programming' started by Denarius, Apr 22, 2008.

  1. Denarius macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #1
    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.
     
  2. larkost macrumors 6502a

    Joined:
    Oct 13, 2007
    #2
    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.
     
  3. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #3
    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
     
  4. Denarius thread starter macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #4
    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.
     

Share This Page