Skip to content
Browse files

Add watchr + .watchr configuration.

  • Loading branch information...
1 parent 00f8a22 commit 8c3237fbc4866aa3751dba52fd0011dfe26afd49 @hmans committed Dec 30, 2011
Showing with 23 additions and 0 deletions.
  1. +22 −0 .watchr
  2. +1 −0 schreihals.gemspec
View
22 .watchr
@@ -0,0 +1,22 @@
+def run(cmd)
+ puts cmd
+ system cmd
+end
+
+def spec(file)
+ if File.exists?(file)
+ run("rspec --fail-fast #{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/schreihals/(.*)\.rb") do |match|
+ puts(match[1])
+ spec("spec/#{match[1]}_spec.rb")
+end
View
1 schreihals.gemspec
@@ -31,4 +31,5 @@ Gem::Specification.new do |gem|
gem.add_dependency 'thor'
gem.add_development_dependency 'rspec', '>= 2.0.0'
+ gem.add_development_dependency 'watchr'
end

0 comments on commit 8c3237f

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