BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

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

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

This item in japanese

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.

Rate this Article

Adoption
Style

BT