Skip to content

Instantly share code, notes, and snippets.

@rdp
Created February 12, 2010 21:07
Show Gist options
  • Select an option

  • Save rdp/302982 to your computer and use it in GitHub Desktop.

Select an option

Save rdp/302982 to your computer and use it in GitHub Desktop.
watch(/.*\/[^\/]+.rb$/) { |filename|
# windows work around for http://github.com/mynyml/watchr/issues#issue/10
if filename[0] =~ /_spec\.rb/
system("spec #{filename} --backtrace")
end
/(.*)\/([^\/]+).rb$/ =~ filename[0]
long_filename = $1 + '/spec/' + $2 + "/#{$2}_spec.rb"
if File.exist? long_filename
system("spec #{long_filename}")
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment