August 11th 2008

“Rails and git submodules can play nice”

I use git submodules to track plugins that I have under active development. This way, I can make changes to the main repository as well as the plugins with minimum fuss. There’s a great tutorial on working with submodules, which includes a couple of gotchas that may explain why submodules have got such a bad rep from some quarters.

Gotcha No. 1 - Always commit changes in your submodules before commiting your main repository

If you make any changes to a submodule, be sure to commit and publish these changes before you commit anything in the main repository, otherwise you and others will have issues trying to clone the repository.

Gotcha No 2 - Check you’re on a branch before making changes

If you are cloning a repo with a submodule and run git submodule init/update, be aware that the submodule has been checked out at a specific commit as apposed to the head of a branch meaning you have to checkout a branch before you make any changes.

June 12th 2008

“Passenger/mod_rails 2.0 RC1”

The guys at phusion have been hard at work improving mod_rails and a release candidate for 2.0 is now available. This includes: rack support; faster graceful restarts; less memory usage; fair load balancing; upload buffering; better stability and much more. Upgrade now for an instant win!

Update: if you have problems installing from the gem, get the latest version from github.

June 2nd 2008

“mod_rails and apache on OS X Leopard”

I was going to write up my experience rolling mod_rails on the default install of Apache to tidy up my development environment, but someone beat me to it
Read the rest…

May 31st 2008

“Rails plugins and the move to gems”

This week, I made my first contribution to core which made installing plugins from git repositories over ssh work. It was a pretty small, mangy little patch - nothing more than fixing a typo in the end - but it felt good giving something back to a framework that has given me so much.

Now that I’m newly freelance, I’m hoping to be able to spend more time giving back to the Rails ecosystem, and the first port of call might have to be the plugin management system. I know plugins are becoming decidedly unfashionable with a lot of smart people saying they you should be using gems instead. And with the recent additions to rails this makes even more sense and you really should be removing those plugins from your apps in favour of loading them as gem dependencies. But in some scenarios, a plugin is all that will do.

In my case, I make use of the engines plugin (another unfashionable and often misunderstood bit of rails goodness) to share common application structure between a few apps, and here the whole plugin-as-gem thing just doesn’t fit.

Having been underwhelmed with the Piston equivalents for git, I’ve found myself using ./script/plugin install again, and although this now works with git repositories, ./script/plugin update doesn’t. Can it be that hard? Time to find out…