This gem teaches autotest to be nice to your Mac’s CPU and harddrive by using FSEvent rather than filesystem polling for monitoring file alterations. The core service FSEvent is available on Mac OS X 10.5 and higher.
Unlike other approaches such as RSpactor, autotest-fsevent does not require RubyCocoa to be installed.
Take a look at the README for installation instructions and more.
Apple has introduced the FSEvent core service in Mac OS X 10.5, a stream which reports all file alterations. While autotest constantly polls the filesystem to detect modifications, with autotest-fsevent FSEvent is used for this at no extra price for neither the CPU, harddrive nor battery.
Without autotest-fsevent:
$ autotest &
[1] 664
$ ps ax 664
664 s000 S+ 0:00.63 /usr/bin/ruby -ws /usr/bin/autotest
-- WAIT 1 MINUTE --
$ ps ax 664
664 s000 S+ 0:01.27 /usr/bin/ruby -ws /usr/bin/autotest
^^^^^^^
And now with autotest-fsevent:
$ autotest &
[1] 698
$ ps ax 698
698 s000 S+ 0:00.63 /usr/bin/ruby -ws /usr/bin/autotest
-- WAIT 1 MINUTE --
$ ps ax 698
698 s000 S+ 0:00.63 /usr/bin/ruby -ws /usr/bin/autotest
^^^^^^^
Since 0.2.0 this gem requires the lightweight autotest gem instead of the more featureful ZenTest suite. If you need the full suite at a later point, simply install the zentest-without-autotest gem alongside. And to use autotest with Rails, install the autotest-rails-pure gem as well. You might have to uninstall the famous autotest-rails gem beforehand as it requires ZenTest.