Daily log - April 21, 2009
by Sean Cribbs
Populate this! I added a database population script to our application today so our designer could work on styling the big Javascript control I wrote. The control relies on loading some JSON data via Ajax on page-load, and he naturally had an empty database initially. In order to quickly and easily accomplish this task, I relied on the populator
and faker
gems. populator
is great, and really fast because it doesn’t instantiate ActiveRecord objects (which has caveats, of course), but faker
is totally AWESOME. I started using it in my test factories (with factory_girl
) too – it was especially helpful on things like names, where I was just giving the factory “Quentin Tarantino”. One of its best features is the ability to generate strings of numbers, which was useful for creating things like student ID numbers.
You got chocolate in my peanut butter! There was a nice talk tonight at raleigh.rb about MacRuby. It seems that Apple is pretty serious about the project and the integration with Xcode is really well done. Kevin said it’s “too clicky and draggy” and gave him nightmares about Visual Studio. In contrast, I had nightmares about doing Java AWT – building interfaces entirely with code – I welcome the clicky-and-draggy! (especially since Interface Builder does it well and without too much ceremony) Letting you hook up the interface directly to your own Ruby classes just rocks. I’m excited to see where this project goes, and maybe I’ll write a GUI app in the near future with Ruby.