Skip to content
Browse files

use guard instead watchr

  • Loading branch information...
1 parent 9b635fc commit 567eb026ab9df4498db3e1829139df80b9ff5b9c @flyerhzm committed Mar 24, 2012
Showing with 26 additions and 35 deletions.
  1. +0 −24 .watchr
  2. +2 −1 Gemfile
  3. +16 −10 Gemfile.lock
  4. +8 −0 Guardfile
View
24 .watchr
@@ -1,24 +0,0 @@
-# vim:set filetype=ruby:
-def run(cmd)
- puts cmd
- system cmd
-end
-
-def spec(file)
- if File.exists?(file)
- run("rspec #{file}")
- else
- puts("Spec: #{file} does not exist.")
- end
-end
-
-watch("spec/.*/*_spec\.rb") do |match|
- puts(match[0])
- spec(match[0])
-end
-
-watch("lib/(.*/.*)\.rb") do |match|
- puts(match[1])
- spec("spec/#{match[1]}_spec.rb")
-end
-
View
3 Gemfile
@@ -10,6 +10,7 @@ gem 'mysql'
gem 'activerecord-import'
gem "rspec"
-gem "watchr"
+gem "guard"
+gem "guard-rspec"
gem "perftools.rb"
View
26 Gemfile.lock
@@ -41,6 +41,12 @@ GEM
diff-lcs (1.1.3)
erubis (2.6.6)
abstract (>= 1.0.0)
+ ffi (1.0.11)
+ guard (1.0.1)
+ ffi (>= 0.5.0)
+ thor (~> 0.14.6)
+ guard-rspec (0.6.0)
+ guard (>= 0.10.0)
i18n (0.5.0)
json (1.6.3)
mail (2.2.19)
@@ -74,32 +80,32 @@ GEM
rake (0.9.2.2)
rdoc (3.11)
json (~> 1.4)
- rspec (2.7.0)
- rspec-core (~> 2.7.0)
- rspec-expectations (~> 2.7.0)
- rspec-mocks (~> 2.7.0)
- rspec-core (2.7.1)
- rspec-expectations (2.7.0)
- diff-lcs (~> 1.1.2)
- rspec-mocks (2.7.0)
+ rspec (2.9.0)
+ rspec-core (~> 2.9.0)
+ rspec-expectations (~> 2.9.0)
+ rspec-mocks (~> 2.9.0)
+ rspec-core (2.9.0)
+ rspec-expectations (2.9.0)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.9.0)
sqlite3-ruby (1.3.2)
thor (0.14.6)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.31)
uniform_notifier (1.0.1)
- watchr (0.7)
PLATFORMS
ruby
DEPENDENCIES
activerecord-import
bullet!
+ guard
+ guard-rspec
mysql
perftools.rb
rails
rspec
sqlite3-ruby
- watchr
View
8 Guardfile
@@ -0,0 +1,8 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard 'rspec', :version => 2, :all_after_pass => false, :all_on_start => false, :cli => "--color --format nested --fail-fast" do
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec" }
+end

0 comments on commit 567eb02

Please sign in to comment.
Something went wrong with that request. Please try again.