15 February 2008

Reducing frequency of autotest file checks

I am using RSpec 1.1.3 with ZenTest-3.9.1 and I wanted to share my set up.

If your cpu is at 100% when autotest is running and the fan noise is getting too much, don't worry there's something you can do.

You can reduce the frequency at which autotest checks for changes on your file system by adding an initialize hook in your ~/.autotest configuration:

gedit ~/.autotest



Autotest.add_hook :initialize do |at|
# Reducing frequency of autotest file checks too 30 seconds. Default is 1s which makes my laptop very hoooot
at.sleep = 30

# Ignore files with suffix
%w{.svn
.hg
.git
.rhtml
.png
.txt
.sh
.project
.rjs
.rake
.jpg
.xml
.xlst}.each { |exception| at.add_exception(exception) }
end


More information about autotest hooks in David Chelimsky blog

No comments: