February 2009

A “better” Rails Development Autoloader

Tuesday, February 17th, 2009

Rails autoloading, while nice in theory, frequently doesn’t work. Back in the day (you young whipper-snappers!), Rails took f–o–r–e–v–e–r to start up the development server.  So they setup a mechanism to auto reload certain classes and files on every request in development mode rather than the whole stack. It was a slick idea, but if your code does anything fancy, it could confuse the autoloader and your app server needs to be restarted manually when you make those changes.

Since Rails 2.3+ is so fast when completely reloading the server, I wrote this script to listen to the given directories, and kill/restart the server when any file is changed. It’s inspired by one of Merb’s development modes as described by Yehuda Katz in a talk he gave last night.

It’s quick, simple, and reliably reloads your application when changes are made.

To install, just copy it into the scripts directory and set it to be executable.

http://gist.github.com/65615

Tags:
Links for Friday, February 13th, 2009

From the “It Isn’t Broke” Department

Wednesday, February 11th, 2009

Overheard on twitter a while back. I’ve been thinking about it a bit.

I love the sense of criticality expoused by some of the CSS trolls: “You have X validation errors?!?!”. Yet, somehow the wheels kept turning – @d2h

Yeah. I totally know what he’s talking about. I’ve heard similar complaints in other industries, too. I mean, look at all those debt-warning trolls that keep cranking on and on about watching our budgets to make sure we as a nation don’t spend more than we make. Don’t they understand that the wheels keep turning? The money keeps flowing in. It doesn’t matter where it comes from. Why, just the other day, I was…

Oh. Yeah.