Interesting Ruby Tidbits That Don’t Need Separate Posts #18
MacRuby: Ruby Running On Top of Objective-C
Most Mac-based Ruby developers are already familiar with RubyCocoa, a bridge that enables regular Ruby apps to talk to OS X's various frameworks. MacRuby, however, takes a rather different approach and is a port of Ruby 1.9 that runs directly on the Objective-C runtime and garbage collector. It's still in its early stages, but for anyone interested in Ruby implementations, this is worth a look.
Try: Stop Using "@person ? @person.name : nil" And Start Using "@person.try(:name)"
try() is a ridiculously simple, but incredibly useful, bit of sugar Chris Wanstrath has come up with for making it easy to "try" and call methods on objects, but without Ruby getting upset if that method doesn't exist.
ProcessorPool: Easily Farm Work to Amazon EC2 Instances
And the Rubyist infatuation with Amazon's EC2 service continues! Ari Lerner and Ron Evans have developed ProcessorPool, a new Ruby library that provides a simple load-balancing solution for Amazon's EC2 and S3 backend. It allows you to "effortlessly farm work to an EC2 instance." The best source of information is Ari's own blog post where some demonstration code is shown.
Heroku Gits an API
Heroku, the much heralded Ruby on Rails online development and deployment platform, has launched an API along with external Git access. The combination of these new features mean that you can work on your Rails applications on your local machine and deploy them on Heroku with just a few simple steps. All you need to do is install the Heroku gem, then use the "heroku" command line app to create an application before finally pushing it back to the Heroku servers with git. Miraculously, pushing your code back to Heroku automatically runs the migrations and restarts the processors on the server. One step deployment!