Add guard

This commit is contained in:
2018-04-07 00:03:25 +01:00
parent 58feb4b6ca
commit bc523aec17
2 changed files with 20 additions and 0 deletions

18
Guardfile Normal file
View File

@@ -0,0 +1,18 @@
# frozen_string_literal: true
group :red_green_refactor, halt_on_fail: true do
guard :rspec, cmd: 'bundle exec rspec' do
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^spec/.+_spec\.rb$})
watch('spec/spec_helper.rb') { 'spec' }
end
guard :rubocop do
watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
watch('Gemfile')
watch('Guardfile')
watch('Rakefile')
watch(/.+\.gemspec$/)
watch(/.+\.rb$/)
end
end