Edit Guardfile to group

This commit is contained in:
Yuan Chiu 2014-10-18 01:07:25 +08:00
parent 6bae15f208
commit ae4d34d8ba

View File

@ -9,24 +9,31 @@
notification :growl notification :growl
# Linux用的通知中心 # Linux用的通知中心
notification :libnotify notification :libnotify
scope groups: [:build, :livereload, :test]
#PHPDoc group :build do
guard :shell do #PHPDoc
watch(%r{htdocs/.+\.(php)}) do guard :shell do
system 'phpdoc', '-d', './htdocs/lib', '-t', './docs/' watch(%r{htdocs/.+\.(php)}) do
system 'phpdoc', '-d', './htdocs/lib', '-t', './docs/'
end
end end
end end
# LiveReload group :livereload do
guard 'livereload' do # LiveReload
watch(%r{htdocs/.+\.(php|css|js|html)}) guard 'livereload' do
watch(%r{htdocs/.+\.(php|css|js|html)})
end
end end
# PHPUnit group :test do
guard :phpunit2, :all_on_start => false, :tests_path => 'tests/', :cli => '--colors -c phpunit.xml' do # PHPUnit
# Run any test in app/tests upon save. guard :phpunit2, :all_on_start => false, :tests_path => 'tests/', :cli => '--colors -c phpunit.xml' do
watch(%r{^tests/.+Test\.php$}) # Run any test in app/tests upon save.
watch(%r{^tests/.+Test\.php$})
# When a file is edited, try to run its associated test.
watch(%r{^htdocs/lib/(.+)\.php}) { |m| "tests/#{m[1]}Test.php" } # When a file is edited, try to run its associated test.
watch(%r{^htdocs/lib/(.+)\.php}) { |m| "tests/#{m[1]}Test.php" }
end
end end