Loading

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. SPF Records with Rails and ActionMailer
  4. High Availability on a Shoestring -- Postgresql 9.0 Streaming Replication
  5. Jekyll Exclude Files
You should follow me on Twitter: @patrickxb