Skip to content

Instantly share code, notes, and snippets.

@ryanmoon
Created June 15, 2016 19:56
Show Gist options
  • Save ryanmoon/c67160f829a5515ac40d1bc955db6937 to your computer and use it in GitHub Desktop.
Save ryanmoon/c67160f829a5515ac40d1bc955db6937 to your computer and use it in GitHub Desktop.
Guardfile for use with Chef Cookbooks
guard "foodcritic", :cookbook_paths => ".", :all_on_start => false, :cli => "--epic-fail any" do
watch(%r{attributes/.+\.rb$})
watch(%r{providers/.+\.rb$})
watch(%r{recipes/.+\.rb$})
watch(%r{resources/.+\.rb$})
watch(%r{^templates/(.+)})
watch('metadata.rb')
end
notification :terminal_notifier
guard :rubocop do
watch(%r{.+\.rb$})
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
end
guard :rspec, cmd: 'bundle exec rspec', :all_on_start => false do
watch(%r{^spec/(.+)_spec\.rb$})
watch(%r{^(recipes)/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { 'spec' }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment