0

So I'm basically trying to recreate what this app: Fluid, already does. I want to write a Ruby script, or MacRuby app that accepts a few parameters and can generate a simple native app.

Since their code is not open-sourced, I can't see how they do it. And I don't know how I would begin to accomplish something like this.

Also, I would like this script to be run on Windows (not that the user could install the generated app, but so the app could be distributed to Mac users).

How could I do something like this?

Solution:

Here is a project that does exactly the same thing that I'm trying to do. It takes an app bundle and does some string replacing on some files in the bundle. I'm going to use it as an example to imitate.

https://github.com/maccman/macgap-rb

Community
  • 1
  • 1
Andrew
  • 227,796
  • 193
  • 515
  • 708

2 Answers2

1

MacRuby can already create native app bundles on OS X (it's a compiler as well as an interpreter), so in a sense there's no question to be answered here. If you want to write an app in MacRuby or Objective-C for OS X, the experience is essentially the same (though, of course, MacRuby has different command line flags for generating the final result, in this case the -deploy flag to MacRuby vs some linker invocation for ObjC). That said, nothing you write in MacRuby will run natively in Windows. Depending on the complexity of the app you have in mind, you may have to go to some cross-platform solution (like Unity) for that.

jkh
  • 3,246
  • 16
  • 13
  • Interesting. Good to know. I know a MacRuby app will only run on a Mac, but I wondered if you could compile it in a non-Mac environment. I'm open to entertaining the idea of using something like Unity. Could you provide a link? I can't seem to find it online. – Andrew Dec 09 '11 at 00:10
0

Check out Prism. It's not Ruby, but it does exactly what you describe and is open-source. One thing you'll to do is embed a web browser into a window, so look for libraries that do that. I'm assuming you'll use Cocoa for GUI since you're using MacRuby. In the end, the simplest way would be just have a window with web browser in it.

Neil
  • 625
  • 1
  • 7
  • 12
  • Thanks! Prism looks a lot like what I'm trying to imitate. So I'll definitely check it out. The "end result app" I understand pretty well (basically a UIWebView), its the act of generating the app (which I assume is compiled in some way) that I don't understand how to do cross-platform. – Andrew Dec 08 '11 at 05:21
  • So I found out that Prism development has been deprecated and [Chromeless](http://mozillalabs.com/chromeless/) has taken it's place. The project is also on [github](https://github.com/mozilla/chromeless). – Andrew Dec 08 '11 at 05:47
  • As I see it, Chromeless for is writing desktop apps in HTML, css etc. What prism does is takes existing websites and turns them into desktop apps. It is deprecated, but you could still learn a lot from it. – Neil Dec 09 '11 at 07:56