Shifra Pride Raffel's blog
I'm planning to make this the first in a series of random small notes about working on a Rails project in an enterprise (by which I mean large-scale, mature-company, high-demand) setting. I'm aiming for small bite-sized dispatches, not for comprehensiveness. [Edited to say: I'm now working on a Java project, so I'm not sure when I will have more to add.] Please chime on in with additions and comments. This post focuses on our installation process. If you've gotten here via google, you're going to find much more systematic guides than this, so be of good cheer!
Interesting Things
- Thin is a new webserver that we haven't tried yet, but we're interested in. It's billed as being faster than Mongrel; it uses the Mongrel parsing engine, Event Machine for I/O, and Rack to interface between server and Ruby framework. Because it uses Rack, it may have problems doing streaming. Anyone have experiences with it to report?
So many of my colleagues have some degree of trouble with their hands/wrists/arms. It's a serious occupational hazard. Agile coding is a slightly different ballgame for me in terms of wrist problems.
Want to avoid feeling like a chump and spending countless hours troubleshooting a crazily-stupid-simple problem?
When you enter a .js in your javascripts directory and include it using a javascript_include_tag, take the <script> tags off the front and back.
You probably knew that already. Why didn't you tell me sooner?
Frankly, I used to disdain Javascript. I thought of it as a toy language (even though my friend Jim Davis implemented a huge nasty content management system in it and kept telling me that there was nothing toy about it). Proficiency in Javascript used to be a marker of low status in my eyes (well, except for Jim, who I just thought of as being perverse). Whenever I had to do anything with it, I swore about the constant errors, the lack of tools, and the general infernal twistedness.
Doing some more javascript and JSUnit stuff today, I'm quite impressed. Firebug allows you to console.debug any object and even to expand your command line to be a good usable size. I finally and reluctantly admit that Javascript is really worth knowing, and you can do serious TDD development with it using JSUnit. Sigh. If only I had listened to you, Jim.
Okay, it's not ready for prime time. But it was entertaining digging into OpenSocial and making some gadgets for the Orkut sandbox. The ability to write arbitrary data easily to a feed stream from the client side is going to be very handy.
Now I just want someone to explain to me why there are already several projects on Rubyforge that claim to be Rails OpenSocial projects. Someone should just port from Shindig after it's ready.
I'm more and more convinced that Object Mothers are the way to go to manage test data. I owe my introduction to this pattern to David Goudreau.
A few users and items in fixture data so that you can start up your application and test without adding things from the UI... and then let your tests be self-sufficient: make an Object Mother that generates objects for you with sensible defaults. Instead of relying on fixtures, you know you have an object that nobody else will change. Excellent for reducing test fragility.
It can make builds a bit slower, but the test robustness is worth the tradeoff to me.
I'm busy adding it to my Selenium Tests today and basking in test robustness.
