Advertisement
Guest User

Untitled

a guest
Sep 25th, 2012
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 2.82 KB | None | 0 0
  1. # A sample Guardfile
  2. # More info at https://github.com/guard/guard#readme
  3.  
  4. guard 'cucumber' do
  5.   watch(%r{^features/.+\.feature$})
  6.   watch(%r{^features/support/.+$})          { 'features' }
  7.   watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
  8. end
  9.  
  10. guard 'livereload' do
  11.   watch(%r{app/views/.+\.(erb|haml|slim)})
  12.   watch(%r{app/helpers/.+\.rb})
  13.   watch(%r{public/.+\.(css|js|html)})
  14.   watch(%r{config/locales/.+\.yml})
  15.   # Rails Assets Pipeline
  16.   watch(%r{(app|vendor)/assets/\w+/(.+\.(css|js|html)).*})  { |m| "/assets/#{m[2]}" }
  17. end
  18.  
  19. guard 'rspec', :version => 2, :cli => "--tag ~browser_required" do
  20.   watch(%r{^spec/.+_spec\.rb$})
  21.   watch(%r{^lib/(.+)\.rb$})     { |m| "spec/lib/#{m[1]}_spec.rb" }
  22.   watch('spec/spec_helper.rb')  { "spec" }
  23.  
  24.   # Rails example
  25.   watch(%r{^app/(.+)\.rb$})                           { |m| "spec/#{m[1]}_spec.rb" }
  26.   watch(%r{^app/(.*)(\.erb|\.haml)$})                 { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
  27.   watch(%r{^app/controllers/(.+)_(controller)\.rb$})  { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
  28.   watch(%r{^spec/support/(.+)\.rb$})                  { "spec" }
  29.   watch('config/routes.rb')                           { "spec/routing" }
  30.   watch('app/controllers/application_controller.rb')  { "spec/controllers" }
  31.  
  32.   # Capybara request specs
  33.   watch(%r{^app/views/(.+)/.*\.(erb|haml)$})          { |m| "spec/requests/#{m[1]}_spec.rb" }
  34.  
  35.   # Turnip features and steps
  36.   watch(%r{^spec/acceptance/(.+)\.feature$})
  37.   watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$})   { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
  38. end
  39.  
  40.  
  41. guard 'rspec', :version => 2 do
  42.   watch(%r{^spec/.+_spec\.rb$})
  43.   watch(%r{^lib/(.+)\.rb$})     { |m| "spec/lib/#{m[1]}_spec.rb" }
  44.   watch('spec/spec_helper.rb')  { "spec" }
  45.  
  46.   # Rails example
  47.   watch(%r{^app/(.+)\.rb$})                           { |m| "spec/#{m[1]}_spec.rb" }
  48.   watch(%r{^app/(.*)(\.erb|\.haml)$})                 { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
  49.   watch(%r{^app/controllers/(.+)_(controller)\.rb$})  { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
  50.   watch(%r{^spec/support/(.+)\.rb$})                  { "spec" }
  51.   watch('config/routes.rb')                           { "spec/routing" }
  52.   watch('app/controllers/application_controller.rb')  { "spec/controllers" }
  53.  
  54.   # Capybara request specs
  55.   watch(%r{^app/views/(.+)/.*\.(erb|haml)$})          { |m| "spec/requests/#{m[1]}_spec.rb" }
  56.  
  57.   # Turnip features and steps
  58.   watch(%r{^spec/acceptance/(.+)\.feature$})
  59.   watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$})   { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement