guard :cucumber do watch %r{^features/.+\.feature$} watch(%r{^features/support/.+$}) { 'features' } watch(%r{^features/step_definitions/(.+)_steps\.rb$}) do |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' end end guard :jasmine do watch(%r{spec/javascripts/spec\.(js\.coffee|js|coffee)$}) { 'spec/javascripts' } watch(%r{spec/javascripts/.+_spec\.(js\.coffee|js|coffee)$}) watch(%r{spec/javascripts/fixtures/.+$}) watch(%r{app/assets/javascripts/(.+?)\.(js\.coffee|js|coffee)(?:\.\w+)*$}) { |m| "spec/javascripts/#{ m[1] }_spec.#{ m[2] }" } end guard :rspec, cmd: 'bundle exec rspec' do require 'guard/rspec/dsl' dsl = Guard::RSpec::Dsl.new(self) rspec = dsl.rspec watch(rspec.spec_helper) { rspec.spec_dir } watch(rspec.spec_support) { rspec.spec_dir } watch(rspec.spec_files) ruby = dsl.ruby dsl.watch_spec_files_for(ruby.lib_files) end