Using %|...| regex in Guardfile example

This commit is contained in:
Thibaud Guillaume-Gentil 2010-11-25 23:35:46 -08:00
parent 7f39a55fdf
commit bb56c41a49

View File

@ -176,11 +176,11 @@ Looks at available guards code for more concrete example.
Guardfile DSL consists of just two simple methods: guard & watch. Example:
guard 'rspec', :version => 2 do
watch('^spec/(.*)_spec\.rb')
watch('^lib/(.*)\.rb') { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('^spec/spec_helper\.rb') { "spec" }
watch('^spec/models/.*\.rb') { ["spec/models", "spec/acceptance"] }
watch('^spec/spec_helper\.rb') { `say hello` }
watch(%|^spec/(.*)_spec\.rb|)
watch(%|^lib/(.*)\.rb|) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%|^spec/spec_helper\.rb|) { "spec" }
watch(%|^spec/models/.*\.rb|) { ["spec/models", "spec/acceptance"] }
watch(%|^spec/spec_helper\.rb|) { `say hello` }
end
- "guard" method allow to add a guard with an optional options hash