Watchr is a continuous-testing tool by Martin Aumont in the vein of Autotest (part of the ZenTest package).
At its heart, Watchr basically watches any (or all!) of your project's files, then executes arbitrary Ruby code of your choice when things change. Watchr configuration takes such a form:
watch('pattern') { |match_data_object| command_to_run }
For example, to produce Autotest-like functionality, you'd just specify Watchr to run the tests whenever a test or some library code changes, like this (taken from Martin's blog post):
watch('test/test_.*\.rb') { |md| system "ruby #{md[0]}"}
watch('lib/(.*)\.rb') { |md| system "ruby test/test_#{md[1]}.rb"}
...but Watchr can be used for much more than just testing. You could use it to automatically generate documentation, build your gem or any other tasks that you can script in Ruby.
To get started with Watchr, just install the gem (from Gemcutter), and run the watchr command from your project root, passing the location of the configuration script:
$ gem install watchr --source=http://gemcutter.org $ cd to/your/project/root $ watchr path/to/script
The source and some documentation (including example scripts) is available on Github, and you can read more on Martin's blog too.
If an even more simplistic route appeals to you, Ruby Inside's editor, Peter Cooper, has a basic Rake task that can run a script of your choice when files change within a project.
Also.. Got a slow Test::Unit or RSpec suite? Run them up to three times faster on Devver's cloud! Setup is simple and requires no code changes. Sign up now!