问题
I'm about to start a project developing a Ruby desktop application. I expect to to be fairly big and I want to learn techniques for dividing code among modules and other techniques for managing complexity. Most large apps I've looked at are Rails apps, but these aren't very helpful, because most of the work is done by Rails itself.
What source code would you recommend I take a look at? I'm not interested in libraries or Rails apps, because I get how they do things. CLI apps are OK, but I'm mostly interested in GUI apps (I'm using Gtk+, but I can learn just as much from apps using other GUI toolkits).
回答1:
The FreeBASE plugin manager system is designed as a way to organize code in GUI applications, and it has worked well for me in my development of Redcar, a Ruby/Gtk text editor.
FreeBASE is nothing to do with the online open database project Freebase, it is something that the FreeRIDE Ruby IDE people developed to make it easier for them to structure a large GUI project.
So FreeBASE is part of FreeRIDE, but also works separately. You can find information about it here.
回答2:
I'm the owner of JotBot, a desktop app for tracking time. It was built using Monkeybars, with JRuby + Swing. It's an extremely robust tool set for cross-platform desktop applications. There is the downside that the use of Swing may interfere with achieving a true native look for any particular desktop, but other than that it is a real win. Plus, using Rawr, you can easily create bundled applications and installers for OSX, Windows, and Ubuntu.
Drop me a line if you have any questions: james@neurogami.com
回答3:
(At the risk of downvotes)
Ruby is my primary language, and would I advise against coding a large desktop application in Ruby, unless the bulk of the code is already written and simply needs a new GUI frontend developed quickly. IMHO, you're in for a world of pain. CRuby isn't the best tool for this job, as it's weak in some areas that are critical for desktop applications e.g. threading, non-blocking IO, 1st class GUI toolkit support, etc...
JRuby or IronRuby are a different stories, though...
回答4:
Check out LimeChat, which is a graphical irc client written in Ruby(Cocoa). Its source code is available on github.
回答5:
Maybe check out FxRuby (a ruby gui library wrapper) to see if that turns up any leads.
You could certainly apply the same organizational principles used for Rails apps and apply them to a desktop app. The Griffon framework (a java Swing framework) basically did that for Grails (essentially a java Rails clone).
回答6:
Heard about JotBot earlier, haven't tried it yet, though.
MonkeyBars also comes to mind, when talking about MVC frameworks for desktop (J)Ruby.
回答7:
Google SketchUp has a Ruby API.
来源:https://stackoverflow.com/questions/1129383/non-trivial-desktop-apps-that-use-ruby