From e1fb1f37e343eef6df9d19632651bd7d0a320191 Mon Sep 17 00:00:00 2001 From: raduwen Date: Sat, 12 Oct 2013 02:48:44 +0900 Subject: [PATCH] Add guard-bundler, guard-migrate --- Gemfile | 2 ++ Guardfile | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 Guardfile diff --git a/Gemfile b/Gemfile index afa8006..01698f3 100644 --- a/Gemfile +++ b/Gemfile @@ -23,6 +23,8 @@ end group :development, :test do gem 'guard-spring' + gem 'guard-bundler' + gem 'guard-migrate' gem 'rspec-rails' gem 'factory_girl_rails' end diff --git a/Guardfile b/Guardfile new file mode 100644 index 0000000..e91afc0 --- /dev/null +++ b/Guardfile @@ -0,0 +1,18 @@ +guard 'bundler' do + watch('Gemfile') +end + +guard 'migrate' do + watch(%r{^db/migrate/(\d+).+\.rb}) + watch('db/seeds.rb') +end + +guard 'spring', :rspec_cli => '--color' do + watch(%r{^spec/.+_spec\.rb$}) + watch(%r{^spec/spec_helper\.rb$}) { |m| 'spec' } + watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } + watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } + watch(%r{^app/controllers/(.+)_(controller)\.rb$}) do |m| + %W(spec/routing/#{m[1]}_routing_spec.rb spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb spec/requests/#{m[1]}_spec.rb) + end +end