Skip to content

Instantly share code, notes, and snippets.

@czj
Created March 8, 2012 20:25
Show Gist options
  • Save czj/2003204 to your computer and use it in GitHub Desktop.
Save czj/2003204 to your computer and use it in GitHub Desktop.
Sample Guardfile for spork+guard+rails+livereload
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'livereload' do
watch(%r{app/.+\.(erb|haml)})
watch(%r{app/helpers/.+\.rb})
watch(%r{(public/|app/assets).+\.(css|js|html)})
watch(%r{(app/assets/.+\.css)\.s[ac]ss}) { |m| m[1] }
watch(%r{(app/assets/.+\.js)\.coffee}) { |m| m[1] }
watch(%r{config/locales/.+\.yml})
end
guard 'spork', :rspec => false, :cucumber => false do
watch('config/application.rb')
watch('config/environment.rb')
watch(%r{^config/environments/.+\.rb$})
watch(%r{^config/initializers/.+\.rb$})
watch('Gemfile')
watch('Gemfile.lock')
watch('test/test_helper.rb') { :test_unit }
end
guard 'minitest', :drb => true do
watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
watch(%r{^test/.+_test\.rb$})
watch('test/test_helper.rb') { "test" }
watch(%r{^app/models/(.+)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
watch(%r{^app/controllers/(.+)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
watch(%r{^app/views/.+\.rb$}) { "test/integration" }
watch('app/controllers/application_controller.rb') { ["test/functional", "test/integration"] }
end
guard 'i18n' do
watch(%r{config/locales/.+\.yml$})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment