-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGuardfile
32 lines (26 loc) · 986 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
# DSL: https://github.com/guard/guard/wiki/Guardfile-DSL---Configuring-Guard
# Disable simplecov as the minimum_coverage failure will overshadow the failed test output in Guard.
# Ref: https://stackoverflow.com/a/17714286/265508
guard :minitest, env: { 'NO_COVERAGE' => 'true' } do
# with Minitest::Unit
watch(%r{^test/(.*)\/?(.*)_test\.rb$})
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}#{m[2]}_test.rb" }
watch(%r{^test/test_helper\.rb$}) { 'test' }
end
guard :rubocop do
watch(%r{.+\.rb$})
watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
end
guard :bundler do
require 'guard/bundler'
require 'guard/bundler/verify'
helper = Guard::Bundler::Verify.new
files = ['Gemfile']
files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
# Assume files are symlinked from somewhere
files.each { |file| watch(helper.real_path(file)) }
end
guard 'yard' do
watch(%r{lib\/.+\.rb})
watch('README.md')
end