Skip to content

Instantly share code, notes, and snippets.

@chussenot
Created September 20, 2016 10:26
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 chussenot/50eeafec9d6716ca4094e0e7debebb51 to your computer and use it in GitHub Desktop.
Save chussenot/50eeafec9d6716ca4094e0e7debebb51 to your computer and use it in GitHub Desktop.
guard :rspec, cmd: 'bundle exec rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^app/(.+)\.rb$}) { |m| "spec/app/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
end
guard :bundler do
require 'guard/bundler'
require 'guard/bundler/verify'
helper = Guard::Bundler::Verify.new
files = ['Gemfile']
files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
# Assume files are symlinked from somewhere
files.each { |file| watch(helper.real_path(file)) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment