Autotest with Rails Tip -- Ignore Files for Less CPU Usage

By default, autotest polls every file in your rails project for changes. By telling it to ignore certain files, you can drastically reduce its CPU usage. It looks for a config file named .autotest either in the working directory or your home directory. For a rails project, my .autotest file looks like this:

Autotest.add_hook :initialize do |autotest|
  %w{.git .DS_Store ._* vendor}.each do |exception|
    autotest.add_exception(exception)
  end
end

You can also use autotest-fsevent (more info here), which eliminates the polling altogether.


Related Posts

  1. Rails Fragment Caching With Multiple Accounts
  2. iPhone/iPad UISearchBar and UISearchDisplayController Asynchronous Example
  3. Jekyll Exclude Files
  4. SPF Records with Rails and ActionMailer
  5. My 5 Must-have vim Plugins
You should follow me on Twitter: @patrickxb