Bowline – A Ruby GUI framework

4
Aug
60

Recently I’ve been working on a Ruby GUI framework called Bowline.

In a nutshell, Bowline lets you build cross platform desktop applications with Ruby, HTML and JavaScript. The idea is to make building desktop apps as simple (and fun) as building Rails websites.

Bowline is built on top of Titanium, a desktop SDK which essentially provides a Webkit window (and loads of useful APIs). The fact that Titanium uses Webkit (and a fairly edge version at that) means that you can take advantage of all those nice CSS3 and HTML5 features, and you can design for one browser.

On top of Titanium, Bowline provides:

  • A way of binding up Ruby and HTML
  • MVC development
  • Helpers, Models etc
  • Gem packaging
  • Generators, console & more

In a desktop app you don’t have the request/response cycle that web frameworks, like Rails, are built around. So, to replace that, Bowline has the idea of ‘Binders’ – Ruby classes that you can bind HTML to – so when the Ruby class changes, the HTML automatically updates.

Additionally I’ve ported the beautiful Aristo theme to CSS3, you can find it on Github here.

Using Titanium’s Developer tool, you can package your applications up for all three OSes, it’ll be sent up to the cloud and built.

Titanium

The rule is show, don’t tell – so here’s a basic Twitter client I’ve written with Bowline. Download the app (OSX only at the moment) here.

Twitter clients are truly the new ‘Hello World’.

Bowline Twitter

It’s early days for both Bowline and Titanium, but progress is quick and I hope we’ll have a fully fledged desktop framework soon.

Enjoy this article?

Consider subscribing to our RSS feed!

Filed under: Bowline

60 Comments

  1. Mattt Thompson
    10:24 am on August 4th, 2009

    Between this and Mac Ruby, there’s almost no excuse not to try out desktop app development. Very, very cool.

  2. Ummm
    10:37 am on August 4th, 2009

    Why is the twitter client just for OS X now? Isn’t Titanium cross-platform?

  3. Alex
    10:49 am on August 4th, 2009

    Ummm: Titanium will be, but I’m running into issues with it on Windows – it doesn’t support much CSS3 and Bowline is running into some issues (which I’m still trying to debug).

  4. Jonathan Conway
    11:20 am on August 4th, 2009

    Looks great, I can’t wait to play around with this when I get home tonight!

  5. ehsanul
    1:51 pm on August 4th, 2009

    Oh, kinda like Adobe Air! I was hoping for something like this to come out sometime, nice work. :)

  6. fstephany
    2:07 pm on August 4th, 2009

    Nice work :)
    When you say “it’ll be sent up to the cloud and built.” I’m wondering if this cloud is owned by Titanium? Is it possible to build the application on my computer/cloud ?

  7. Alex
    2:34 pm on August 4th, 2009

    fstephany: Yes and yes. I think Appcelerator will charge for their cloud building service, but you can do that yourself manually. The software is completely open source.

  8. Matchu
    2:55 pm on August 4th, 2009

    I still think it’s funny that it says “cross-platform” then “OSX only” xP

    Just teasin’. This looks neat :o

  9. Conner
    5:44 pm on August 4th, 2009

    sounds a bit like Shoes? http://shoooes.net/

    or, better question: how is this different from Shoes?

  10. Alex
    5:55 pm on August 4th, 2009

    Conner:
    * Bowline apps are developed in HTML/JS – Shoes apps are pure Ruby.
    * Bowline respects MVC.
    * Shoes is more developed at this time.

  11. Mark Murphy
    10:31 am on August 5th, 2009

    Any thoughts vis a vis bowline for Titanium Mobile (iPhone/Android targets for Titanium-style apps)?

  12. Adrian Madrid
    12:43 pm on August 5th, 2009

    This sounds awesome. Anything I can do to help with development?

  13. lowell
    1:44 pm on August 5th, 2009

    i wanted to try the twitter demo app, but didn’t like the part where it tried to `install` stuff just to run it. since it wasn’t specific with what it was going to install (the app itself in /Applications, supporting frameworks, spyware), i didn’t install it. an installer app should be labeled as such, not hidden within the app bundle, so users know what they’re getting into.

    also if it was going to install frameworks, app bundles in mac os x should generally have app-specific supporting frameworks contained inside the bundle at /Contents/Frameworks/. they don’t need a separate install this way. look in a lot of current apps using, say Sparkle, for example. they don’t link to whatever the current Sparkle version is, just whatever the app was built against (and included); this gets the app running without the user worrying about the plumbing.

    i’m gonna fork bowline so i can take a peek and see if i can lend a hand anywhere.

  14. lowell
    1:46 pm on August 5th, 2009

    ” at /Contents/Frameworks/. ” should read ” at {App Bundle.app}/Contents/Frameworks/. i was stupid and used angle brackets, which WP ate.

  15. Alex
    2:04 pm on August 5th, 2009

    Mark:
    I think you can Ruby on the iPhone with rhodes: http://github.com/rhomobile/rhodes/tree/master
    And you can run Ruby on the Android with JRuby I presume.

    So, it’s certainly possible. However the overhead (cpu/size) of running Ruby may stop you.

  16. bh
    2:50 pm on August 5th, 2009

    Nice idea but the user experience is pretty awful.

    - the first thing I see when I launch your Twitter example is a dialog box with a warning icon in it, and something called Titanium. If I’m an end-user, I don’t have any idea what Titanium is, why this dialog box that looks like an error popped up at all, etc. I’d stop right there and get a different app that launched without any prompts or things that look like errors.

    - what on Earth is being “installed”? I already downloaded the app. That should be it. Done. Yet, I am given a UI that shows me that 16 anonymous “things” are being downloaded. No thanks. Try next app.

    - The twitter login dialog does not look like a native OS dialog. Of course not, this is a browser, I understand that. But still, that right there is another showstopper.

    I haven’t tried MacRuby of any other Cocoa bridge for Ruby before. I heard of Bowline and was intrigued by the concept of writing desktop apps in Ruby. Given the above issues however, I’ll try something else for now.

    Thanks, and good luck!

  17. Alex
    6:06 am on August 6th, 2009

    lowell:
    That’s a Titanium network install – you can choose whether you want to bundle everything up in the app, or have a network installer (smaller size).
    I agree that ideally the downloaded components would go in Frameworks, so other Titanium apps could use them. However Titanium is cross platform, and I imagine they want to keep the codebase as similar as possible across all the platforms.

  18. Alex
    6:11 am on August 6th, 2009

    bh:
    You’re a hard guy to please…

    1) I imagine Appcelerator’s lawyers insist on this, much like Adobe AIR. Personally I don’t have a problem with it.

    2) It’s a network install, keeping the app size down. Alternatively you can choose to bundle everything up in the app.

    3) Twitter login can look like a native app if you want it to, I was following the HUD Aristo theme. Personally I prefer it, and other mac apps, like Tweetie, also have some customized styling. This is a deal breaker for you?

    Good luck in your search for your perfect GUI framework.

  19. Eric Berry
    12:16 pm on August 7th, 2009

    Does the SDK install when you download and install the Titanium Developer.dmg? If so,what’s the path to the sdk? I am getting errors saying that I can’t run the apps b/c the Titanium SDK path is not set up correctly.

    BTW.. Awesome job!!!

  20. Alex
    3:41 am on August 8th, 2009

    Eric:
    What os are you on? You can specify an explicit path to Titanium using the TIPATH env variable.

  21. Eric Berry
    10:07 am on August 8th, 2009

    I’m on Mac OS X Leopard. It doesn’t work if I set the TIPATH to the installed app in appllications.

  22. Eric Berry
    12:50 pm on August 8th, 2009

    I got it figured out. Final TIPATH was /Library/Application Support/Titanium

    I’m eager to start using this thing.

  23. Brendan
    2:57 am on August 10th, 2009

    Is it wrong to kinda be in love with you right now? It’s all the awesomeness.

  24. Filipe Coimbra
    4:57 pm on August 10th, 2009

    Hey Alex
    I’ve been playing around with Bowline for the last couple of days and I quite liked it.

    Anyway, at github you said that bowline supported ActiveRecord models, but that doesn’t seems the case (at least for me) as ActiveSupport raises an error (`load_missing_constant’: uninitialized constant ActiveRecord) when I create a model.

    I worked this around creating an initializer requiring the ActiveRecord package and establishing a connection (I posted about this on my blog, if you’re interested).

    And thanks about Bowline.

  25. Alex
    5:42 pm on August 10th, 2009

    Filipe:
    You need to add this in environment.rb:

    config.frameworks << :active_record

  26. Filipe Coimbra
    5:49 pm on August 10th, 2009

    Way easier than my hack, Alex.
    Thanks a lot.

  27. roger rubygems
    6:00 pm on August 10th, 2009

    No windows download? :)

  28. Tobias Braner
    6:23 am on August 13th, 2009

    Hi Alex,

    great. I appreciate your work. :) I think this concept of desktop application development will have a big impact in the future. Keep hacking :D

    Regards,
    Tobias

  29. Kane
    4:49 pm on August 14th, 2009

    I’m trying to install twitter example, but after ’script/run’ it returns an error
    “Couldn’t determine your source distribution for packaging runtime version 0.4.4. Please specify.”

  30. jonny
    9:02 pm on August 23rd, 2009

    @Kane, I’m having the same issue. Does anyone have a fix for it? I’m thinking it’s something with titanium itself.

  31. Peter
    3:00 am on October 18th, 2009

    Great work!

    Just wondering, if you were to build a commercial application with Bowline/Titanium, how would you hide the Ruby code so that users/competitors can’t just copy it?

  32. Alex
    3:51 am on October 19th, 2009

    With Ruby 1.9 you should be able to byte compile your code, so the actual source isn’t shipped. That should provide some protection.

  33. sheri
    4:37 am on November 7th, 2009

    hi… very nice …i,d like send me pictuers.. thanks .

  34. Hugo Corbucci
    9:22 pm on December 5th, 2009

    @Kane and @jonny
    I’ve had the same issue. The titanium version you have is different than 0.4.4.
    Discover the titanium version you have (current on for 2009-12-05 is 0.7.0) and look for the manifest file in the twitter app (if you tried building it there will be three of them). Replace every occurrence of 0.4.4 by your version in manifest files and it will run ok.

  35. angel
    12:22 am on February 21st, 2010

    and what happen w windows users?? :(…

  36. Beavis
    3:49 pm on March 1st, 2010

    Copyright protects you dingleberry. If you think source can’t be extracted from a “release” executable, you need to find a new field.

    Anyway, what the hell is with OS X/Ubuntu? Does it not support the better Linux distros? Such as SuSE and Fedora? Why support a third rate Linux distro and why only support one? WTF?

  37. AD
    3:28 am on September 12th, 2010

    I’m interested in using Bowline for a SQLite app that I would like to launch on Mac and Windows, but I am concerned about whether it works on Windows or not, some earlier posters say it doesn’t. Could you clarify where Bowline is in terms of Windows?

    Also, you say it lives on top of Appcelerator’s Titanium product; does this mean I have to sign up to their paid service?

    Finally, is there a workaround to the Windows issue to buy the Titanium product and then put your Bowline into that? I’m not sure how to do that, but if you can post a blog solely on deployment (ie: WindowsXP, Vista, 7, etc) ,that’d be great.

  38. Cheap Asics
    4:25 am on March 28th, 2011

    Thanks for the thoughts you have discussed here. On top of that, I believe there are a few factors that really keep your auto insurance premium lower. One is, to take into account buying vehicles that are inside the good list of car insurance corporations. Cars which can be expensive are definitely more at risk of being lost. Aside from that insurance policies are also in line with the value of the car, so the costlier it is, then higher this premium you pay.

  39. Lashunda Winson
    5:04 am on June 24th, 2011

    After a year in therapy, my psychiatrist said to me, ‘Maybe life isn’t for everyone.’ lol!

  40. Andira
    10:52 pm on April 3rd, 2012

    great articles and stylish website, keep up with the good work guys.http://www.decolarpassagens.net

  41. emediank
    8:10 am on November 1st, 2012
  42. blooknig
    4:15 am on December 25th, 2012

    I’m sure the best for you [URL=http://replicachanelbags1.blogtrue.com/ – replica chanel bags[/URL – for less HYzJQdZB [URL=http://replicachanelbags1.blogtrue.com/ – http://replicachanelbags1.blogtrue.com/ [/URL -

  43. jexShelo
    12:18 am on February 16th, 2013

    sell [URL=http://www.blogvan.nl/coachpursesoutletonlinekk/ – coach online stores[/URL – suprisely hYyLkLYe [URL=http://www.blogvan.nl/coachpursesoutletonlinekk/ – http://onlinecoachhh.mzk-pulawy.pl/ [/URL -

Leave a comment

RSS feed for comments on this post