BT

Apple and Ruby Roundup: iPhone Config Utility on Rails, SproutCore Tools in Ruby

by Werner Schuster on Aug 05, 2008 |
Apple has been using dynamic languages for a long time. The current MacOS X is based on NextStep, which made heavy use of Objective-C, a language now very much en vogue since the release of the iPhone SDK (3rd party developers need to use Objective-C for writing iPhone applications). Apple's WebObjects framework was also written in Objective-C before its port to Java.

A closer look at some of Apple's latest software releases shows another dynamic language: Ruby. The most obvious is MacRuby, the Ruby 1.9 port for MacOS X, which leverages Objective-C's mature runtime and GC and allows easy integration with the Objective-C based Cocoa.

Another example is the iPhone Configuration Web Utility - a tool for the Enterprise use of the iPhone, which allows to manage iPhones in a company. A closer look at the Configuration Utility's user guide shows that it's written using Ruby on Rails (from the user guide):

installpath/vendor/rails/railties/lib/commands/servers/mongrel.rb  

The tool uses Mongrel on MacOS X and Webrick on Windows.

SproutCore is the toolkit Apple uses for the client side of it's MobileMe applications. While the body of Sproutcore is Javascript that is run in the browser, it's toolset is built with Ruby. The first clue comes from the download/installation instructions for Sproutcore:

sudo gem install sproutcore 

SproutCore is installed as a Ruby Gem for a reason: it comes with a toolset to get developers started with developing applications. Developer with Rails or other Ruby frameworks will recognize the concepts. A new SproutCore project is created with

sproutcore app_name 

The generated project contains a directory layout set up with necessary libraries and a skeleton application ready to run. SproutCore also uses Generators, written in Ruby, to create models and other aspects of the SproutCore application. Generation of HTML artifacts is done using Merb. To run a SproutCore app during development, either Mongrel or Thin are used to serve the content.

Finally, not an Apple project, but useful for Ruby developers working with Objective-C: Dr Nic shows how to test Objective-C applications (also for the iPhone) using Ruby.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT