Bundler + Watchr
20 Aug 2010
If you’re using test-driven development (and it’s definitely a cliche by now, but if you’re not – you should be), I highly recommend Watchr to run your test suite. The concept is simple: whenever you save a file, it runs the related tests for you. It’s basically a modernized autotest, and I couldn’t live without it. It’s totally the best workflow ever.
Lately I’ve been switching my Ruby projects to the new Bundler system for managing gem dependencies. With Bundler, whenever you add a gem into your Gemfile, you have to then run “bundle install” to grab it. If you’re already using Watchr to autorun your tests, it is trivial to automate this.
Just add this line to your test/test.watchr (or whatever you call it).
watch('Gemfile') { puts `bundle install` }
Add a gem to your Gemfile, hit save… gem installed!