Thursday, November 16, 2006

Ruby

I am about halfway through the Pragmatic Programmer book, and have decided to take up a proof of concept project in Ruby. I don't want to go the RoR route; the idea is to do just the domain objects in Ruby, and hook it up to a front-end via SCA/WSDL using SOAP. ActiveRecord seems to be a logical choice for this. Some things I've learned/realised along the way:
  1. You should set the RUBYOPT environment variable to 'rubygems' if you want to use Gems things in your code.

  2. "No configuration files" sounds great in theory, but doesn't amount to much when configuration information is stored .rb files. How much ever this information is legal Ruby code, it's still configuration information (I know, this is an RoR thing) Update: It's actually "No XML configuration files". Weasel wording, if you ask me.

  3. Consider this:
    class Test
      print "In test"
    end
    When this code is executed, the "In test" message is printed. Not exactly rocket science, but it took me this bit of code to realise that what stumped me the other day was the equivalent of the static block in Java.