How to Use: guard

  1. Add these gems to your Gemfile:
group :development do
  gem 'guard'
  gem 'guard-shell'
  1. Install it by running bundle install.

  2. Create a Guardfile containing:

# frozen_string_literal: true

clearing :on

guard :shell do
  watch(%r{(?:lib|test)/(.*)\.rb}) { |_m| `bundle exec rake test` }
  1. Create the following entry in a Makefile:
.PHONY: guard
	@bundle exec guard
  1. Run it when doing development:
make guard
  1. Enjoy auto-executing tests and tasks!