-
Notifications
You must be signed in to change notification settings - Fork 0
/
Guardfile
39 lines (33 loc) · 942 Bytes
/
Guardfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
# Add files and commands to this file, like the example:
# watch(%r{file/path}) { `command(s)` }
#
# Mac用的通知中心
#notification :growl
# Linux用的通知中心
#notification :libnotify
scope groups: [:build, :livereload, :test]
group :build do
#PHPDoc
guard :shell do
watch(%r{htdocs/.+\.(php)}) do
system 'phpdoc', '-d', './htdocs/lib', '-t', './docs/'
end
end
end
group :livereload do
# LiveReload
guard 'livereload' do
watch(%r{htdocs/.+\.(php|css|js|html)})
end
end
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