Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 28th, 2012  |  syntax: None  |  size: 1.89 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. group 'backend' do
  2.   guard 'bundler' do
  3.     watch('Gemfile')
  4.   end
  5.  
  6.   guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
  7.     watch('config/application.rb')
  8.     watch('config/environment.rb')
  9.     watch(%r{^config/environments/.+\.rb$})
  10.     watch(%r{^config/initializers/.+\.rb$})
  11.     watch('spec/spec_helper.rb')
  12.   end
  13.  
  14.   guard 'rspec', :version => 2 do
  15.     watch(%r{^lib/(.+)\.rb$})     { |m| "spec/lib/#{m[1]}_spec.rb" }
  16.    
  17.     watch(%r{^spec/(.+)_spec\.rb$})                     { |m| "spec/#{m[1]}_spec.rb" }
  18.     #watch(%r{^spec/factories/(.+)_factory\.rb$})        { |m| "spec" }
  19.     watch(%r{^app/(.+)\.rb$})                           { |m| "spec/#{m[1]}_spec.rb" }
  20.     watch(%r{^lib/(.+)\.rb$})                           { |m| "spec/lib/#{m[1]}_spec.rb" }
  21.     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"] }
  22.     watch(%r{^spec/support/(.+)\.rb$})                  { "spec" }
  23.     watch('config/routes.rb')                           { "spec/routing" }
  24.     watch('app/controllers/application_controller.rb')  { "spec/controllers" }
  25.   end
  26.  
  27.   guard 'cucumber' do
  28.     watch(%r{^features/.+\.feature$})
  29.     watch(%r{^features/support/.+$})          { 'features' }
  30.     watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
  31.   end
  32. end
  33.  
  34. group 'frontend' do
  35.   guard 'coffeescript', :input => 'app/assets/javascripts', :output => 'public/javascripts'
  36.   guard 'coffeescript', :input => 'spec/coffeescripts', :output => 'spec/javascripts'
  37.  
  38.   guard 'jasmine-headless-webkit' do
  39.     watch(%r{^app/assets/javascripts/(.*)\..*})
  40.     watch(%r{^spec/javascripts/(.*)\..*})
  41.   end
  42.  
  43.   guard 'jammit' do
  44.     watch(%r{^public/javascripts/(.*)\.js})
  45.     watch(%r{^public/stylesheets/(.*)\.css})
  46.   end
  47. end