Skip to content

Instantly share code, notes, and snippets.

@jbodah
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbodah/6daca90c5d85f5acadd6 to your computer and use it in GitHub Desktop.
Save jbodah/6daca90c5d85f5acadd6 to your computer and use it in GitHub Desktop.
my guardfile
# require 'guard/plugin'
#
# module ::Guard
# class BackupifyTest < ::Guard::Plugin
# def run_all
# end
#
# def run_on_changes(paths)
# paths.each do |path|
# raise :task_has_failed unless system "ruby -Itest #{path}"
# end
# end
# end
# end
guard :minitest, spring: true, all_on_start: false do
# Application code
watch(%r{^app/models/(.+)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
watch(%r{^app/controllers/(.+)\.rb$}) { |m| "test/functionals/#{m[1]}_test.rb" }
# Test files
watch(%r{^test/(unit|functionals|integration|script)/(.+)\.rb$}) { |m| "test/#{m[1]}/#{m[2]}.rb" }
end
guard :rubocop, all_on_start: false do
# Application code
watch(%r{^app/(.+)\.rb$}) { |m| "app/#{m[1]}.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "lib/#{m[1]}.rb" }
end
guard :flog do
# Application code
watch(%r{^app/(.+)\.rb$}) { |m| "app/#{m[1]}.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "lib/#{m[1]}.rb" }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment