forked from rubyworks/facets
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Guardfile
56 lines (46 loc) · 1.15 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# to run both groups
# $ bundle exec guard
# to run just qed demos
# $ bundle exec guard -g qed
# to run just tests
# $ bundle exec guard -g test
PATH = "lib/core:lib/standard"
# the double-colons below are *required* for inline Guards!!!
module ::Guard
class Qed < Plugin
def run_all
puts 'Running all demos'
puts `qed -I#{PATH} demo`
end
def run_on_modifications(paths)
puts "Running demo for #{paths}"
puts `qed -I#{PATH} #{paths.join(' ')}`
end
end
end
module ::Guard
class Rubytest < Plugin
def run_all
puts 'Running all tests'
puts `ruby-test test`
end
def run_on_modifications(paths)
puts "Running test for #{paths.join(' ')}"
puts `ruby-test #{paths.join(' ')}`
end
end
end
group :qed do
guard :qed do
watch('demo/applique/') { 'demo' }
watch(%r{^lib/(.+)/facets/(.+\.md)$}) { |m| "demo/#{m[1]}/#{m[2]}" }
watch(%r{^demo/.+/.+\.md})
end
end
group :test do
guard :rubytest do
watch('etc/test.rb') { 'test' }
watch(%r{^lib/(.+)/facets/(.+)/(.+\.rb)$}) { |m| "test/#{m[1]}/#{m[2]}/test_#{m[3]}" }
watch(%r{^test/.+/test_.+\.rb$})
end
end