-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGuardfile
More file actions
38 lines (31 loc) · 1.27 KB
/
Guardfile
File metadata and controls
38 lines (31 loc) · 1.27 KB
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
# frozen_string_literal: true
# More info at https://github.com/guard/guard#readme
guard :rubocop, cli: '--format progress --out tmp/rubocop_status.txt ',
all_on_start: true, all_after_pass: true do
watch(/.+\.rb$/)
watch(/bin/)
watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
end
guard :rspec, cmd: 'bundle exec rspec --format progress --out tmp/rspec_status.txt --format progress 2> /dev/null',
all_on_start: true, all_after_pass: true do
require 'guard/rspec/dsl'
dsl = Guard::RSpec::Dsl.new(self)
# RSpec files
rspec = dsl.rspec
watch(rspec.spec_helper) { rspec.spec_dir }
watch(rspec.spec_support) { rspec.spec_dir }
watch(rspec.spec_files)
# Ruby files
ruby = dsl.ruby
dsl.watch_spec_files_for(ruby.lib_files)
# Watch lib files and run corresponding specs
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^lib/mtg_card_maker/(?<filename>.+)\.rb$}) { |m| "spec/mtg_card_maker/#{m[:filename]}_spec.rb" }
watch(%r{^lib/mtg_card_maker/layers/(?<filename>.+)\.rb$}) { |m| "spec/mtg_card_maker/#{m[:filename]}_spec.rb" }
end
# Single shell guard for card/sprite diff and summary
guard :shell, all_on_start: true do
watch(/^(lib|spec|examples|bin).*$/) do
`bin/status_summary`
end
end