A “better” Rails Development Autoloader
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.