guard :rspec, cmd: 'bundle exec rspec' do # watch /lib/ files watch(%r{^lib/(.+).rb$}) do |m| "spec/#{m[1]}_spec.rb" end # watch /spec/ files watch(%r{^spec/(.+).rb$}) do |m| "spec/#{m[1]}.rb" end 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