Skip to content

Instantly share code, notes, and snippets.

@ybur-yug
Created February 11, 2014 17:53
Show Gist options
  • Save ybur-yug/8940236 to your computer and use it in GitHub Desktop.
Save ybur-yug/8940236 to your computer and use it in GitHub Desktop.
notification :terminal_notifier
guard :rspec do
watch('spec/spec_helper.rb') { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }
watch('spec/spec_helper.rb') { "spec" } # purely a failsafe to ensure spec_helper stays classy
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
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"] }
end
guard 'cucumber', :cli => '--no-profile --color --format pretty --strict' do
watch(%r{^features/.+\.feature$})
watch(%r{^features/support/.+$}) { 'features' } # Run all features when any support file changes.
watch(%r{^features/step_definitions/.+$}) { 'features' } # Run all features when any step definitions change.
end
guard 'bundler' do
watch('Gemfile')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment