From ae4d34d8ba8b8169abb886174c4e861967cfe951 Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Sat, 18 Oct 2014 01:07:25 +0800 Subject: [PATCH] Edit Guardfile to group --- Guardfile | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/Guardfile b/Guardfile index bd862b6..7c93181 100644 --- a/Guardfile +++ b/Guardfile @@ -9,24 +9,31 @@ notification :growl # Linux用的通知中心 notification :libnotify +scope groups: [:build, :livereload, :test] -#PHPDoc -guard :shell do - watch(%r{htdocs/.+\.(php)}) do - system 'phpdoc', '-d', './htdocs/lib', '-t', './docs/' +group :build do + #PHPDoc + guard :shell do + watch(%r{htdocs/.+\.(php)}) do + system 'phpdoc', '-d', './htdocs/lib', '-t', './docs/' + end end end -# LiveReload -guard 'livereload' do - watch(%r{htdocs/.+\.(php|css|js|html)}) +group :livereload do + # LiveReload + guard 'livereload' do + watch(%r{htdocs/.+\.(php|css|js|html)}) + end end -# PHPUnit -guard :phpunit2, :all_on_start => false, :tests_path => 'tests/', :cli => '--colors -c phpunit.xml' do - # 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" } +group :test do + # PHPUnit + guard :phpunit2, :all_on_start => false, :tests_path => 'tests/', :cli => '--colors -c phpunit.xml' do + # 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" } + end end \ No newline at end of file