Interesting Ruby Tidbits That Don’t Need Separate Posts #18

Post by Peter Cooper

Permanent Link  |   book mark Interesting Ruby Tidbits That Don’t Need Separate Posts #18 in del.icio.usDel.icio.us  |   See this page in technoratiCosmos

Ruby In Steel Releases Alpha of IDE for “IronRuby”

ironrubysteel.png

Huw Collingbourne writes in to tell us that Sapphire Steel, the company behind Ruby In Steel, has released the first alpha version of a Ruby In Steel IDE for Microsoft’s IronRuby .NET Ruby implementation. A particularly interesting development is that a visual form designer is included that enables you to drag and drop controls onto forms, as if you were designing a, say, Visual Basic app. Being able to develop Windows applications visually seems quite an appealing prospect.

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!

4 Responses to “Interesting Ruby Tidbits That Don’t Need Separate Posts #18”

  1. #1
    Fred Says:

    Wow, Heroku really rocks.

  2. #2
    dubek Says:

    Regarding Chris Wanstrath’s try(), I’d at least allow it to accept methods that need arguments, so:

    class Object
    def try(method, *args)
    send(method, *args) if respond_to? method
    end
    end

  3. #3
    ic9 Says:

    Instead of the try(:name),
    http://blog.rubyenrails.nl/articles/2008/02/29/our-daily-method-18-nilclass-method_missing

  4. #4
    Trans Says:

    I would suggest:

    ##
    # @person ? @person.name : nil
    # vs
    # @person.try(:name)
    def try(method, default=nil)
    respond_to? method ? send method : default
    end

    T.

    T.