Open Source


Earlier I mentioned the contest that CD Baby is putting on in cooperation with WorkingWithRails. I’d hoped that my Duration patch (which was accepted) would be enough to keep me in the running until the 22nd. By chance I also ran into a problem with the PostgreSQL adapter while working, and took some time to fix it. That was actually accepted just a few hours after I wrote it and made it into 1.2, which was recently released.

I think it’s great how much activity this contest has spurred. There are many, many documentation patches now. People have been using Kevin Clark’s Heckle to find gaps in Rails’ test suite and writing patches to fill those gaps. People’s little pet peeves are now being submitted as patches (mine included). The downside is that the core guys now have a lot more work to do, but now that Rails 1.2 is out they’ve got a little more time.

So thanks to everyone on this list - those who have contributed to Rails within the last 20 days or so. Rails has a pretty amazing community and it’s great to work with such talented, devoted people. I’m sure the activity will die down a little after the 22nd, but at least for me it’s helped me feel a bit more a part of the community, and I bet others feel the same. Hope to see you all at RailsConf!

At the Ruby meetup Josh Susser mentioned that CD Baby, a Portland-based Rails shop, has purchased 20 tickets to RailsConf ‘07 as well as 0 hotel rooms in the area (Portland). These will go to the top 20 contributors from Jan 1 to Jan 22. I checked the list and found that, as of yesterday, I’m in the top 20. Hopefully my Duration patch will be accepted and I’ll stay in the top 20 until the 22nd. Any suggestions?

Having a full-time Rails job can really spur you to find out more about what’s going on in Ruby and Rails. I’ve found that I’ve learned quite a bit about what’s going on in the last month and that I’m still learning at a breakneck pace, so here goes, in no particular order:

Piston

“Vendor branch management” gem that lets you store other projects (like Rails plugins) inside your own repository while retaining the ability to update them. This is particularly useful with Rails because you don’t really want to have outbound connections fetching your svn:externals every time you do a Capistrano deploy.

All my svn:externals have been Piston-ized.

EZ-Where

A Rails plugin that allows building the ActiveRecord find options hash based on Ruby code:

Article.findwhere(:all) { |article| article.publishedat < => (from..to) }

Great for complex queries. Using this plugin in WishRadar cut about 45 lines of code that generated SQL manually into about 12 of easy-to-read ruby.

Continuous Builder

An “Official” Rails plugin to make it easy to set up continuous integration testing with email and Campfire notification support. I’ve been using this for about two weeks and it’s pretty reliable, though setting it up with a Subversion post-commit and getting migrations to run is a little tricky. My hacked continuous_builder.rb’s make method:

def make @output = cd #{@options[:application_root]} && #{@options[:bin_path]}rake db:migrate RAILS_ENV=test && #{@options[:bin_path]}rake db:migrate RAILS_ENV=development && #{@options[:bin_path]}rake #{@options[:task_name]} RAILS_ENV=test make_successful? end

To prevent Subversion from blocking when doing a commit, run scripts with STDERR redirected to STDOUT and put the process in the background:

/path/to/continuous-builder 2>&1 &

“My Rails Toolbox” Article

Wonderful list of stuff to use on a Rails site if you’re serious about going to production.

Caboo.se RDOC Documentation Project

They’ve started work on an app to make it easy to produce diffs for documentation purposes. Better Rails docs now!

FixtureScenarios

A large fixture set is very hard to manage, so a plugin to keep them in discrete ’scenarios’ making them independent and “preventing you from changing your assumptions in a dangerous way” is a great idea. Beware, though - it may not play nice with other fixture-related plugins. (in case you’re wondering, it’s better than FixtureSets)

memcached

A network-enabled memory store that basically acts like a giant hash. Good for sessions and whatever other data you need to cache in your app. See the article. Haven’t used it much but I’m looking forward to it (trying to avoid the premature optimization itch).

QueryTrace

A plugin to print a stack trace with each SQL query in your logs. This hasn’t proved invaluable yet, but I’m guessing that once we start optimizing our queries and caching, it’ll be a lifesaver.

hpricot

Fast - like C fast - forgiving HTML parsing. Yeah baby.

Rails 1.2

This will include ActiveResource, DHH’s latest code built to tackle one half of the REST web services problem, as well as some nifty enhancements to routes that will cover the other half.

RSpec

Unit testing done in a more DSLish way. Specify what should happen, and in what contexts, and you’re halfway done with your tests. Really more of a psychological helper than anything else, but that’s what good DSLs are for, right? Check it out at rubyforge. I haven’t tried this yet, but it’s on my list.

No that’s not an accidental ‘S’ on the end. Read more at DrunkenBlog.

What a scam.

There’s an open source project that I’ve loosely followed called PearPC that has a pretty cool idea: create an emulator for the PPC (Mac, IBM) architecture that runs on the x86 (Intel, AMD) architecture, allowing you to run Mac OS X or any of the PPC Linux OS’s from within Windows. Neat.

Now there’s this other software called CherryOS that supposedly lets you do the same thing. It was announced long before the release, so many people considered it to be vaporware. It was finally released, and people have found some pretty damning evidence that it has completely ripped off the PearPC project.

This is what I hate about people - they will do anything to get a short-term gain. This is a violation of the GPL, but the makers of this “product” don’t seem to care. I hope they get their asses handed to them on a platter by the FSF.

My usual practice in the past regarding shareware was to find an activation key online, usually at AstalaVista. The reason for this is that I had no job, and had no money beyond my ‘allowance’. I didn’t pay for it simply out of habit, and I regarded shareware as somehow inferior to freeware.

I’m not reversing my position, but the fact that I’ve bought TextMate, Transmit, and NewsFire in the last 30 days tells me I’ve undergone some sort of paradigm shift. I think this came about when I started thinking about my own soon-to-be-looking-for-a-job self. I think it’d be cool to be able to sustain myself on the applications I’ve written as part of a small company. I’ve never really much liked working for others, so the self-employment route looks appealing to me. Sometime over the last few months I’ve realized, though perhaps not fully consciously, that all these apps I’ve been pirating are made by guys (yeah, not many women in this field) who feel the same way, and by not paying for the apps I use, I’m preventing them from achieving that goal. I certainly wouldn’t want this to happen to me, so I’ve begun to acknowledge the right of these people to be paid for their work.

Open Source is another model I find intriguing. It involves a few people to a few thousand people who collaboratively work on the project. The code is out in the open. It’s free, and because of this it lacks the normal pay-to-use mechanism of proprietary software. It requires another motivator. Some people are paid to work on open source projects by the companies they work for (IBM, RedHat). Some open source projects make money through services and support. Many die because they lack a persistent motivator, and this is too bad.

I’ll sidestep the issue of which model is better and claim that they are good for different things. The nature of the project should determine what model is used. An extension to the HTTP protocol to handle flash crowds? Open source. A standards-compliant web browser? Open source. A marketing tool masquerading as a web browser? Proprietary. A specialized text editor for developers. Either way. When something can be built on top of and is meant to be built on top of, open source is probably best. If not, proprietary is fine. As for me, I hope to do some of both in the future.

This is the start of my own site, which I will use for my own purposes. If you’d like to read it, fine. Mostly it’s just things that I think are cool and would like to express, regardless of whether anyone reads it. The rest of it will be commentary on things in my life or related.

First off, there’s this cool post over at DrunkenBlog about a project called Portable Firefox, a subproject of the Firefox project. It basically is a stripped-down version of Firefox for Windows that is only 8.6MB, perfect for a keychain drive. Why would you want this? I use Firefox whenever I have to use Windows, but sometimes a computer lab will not have it. Now it will.