Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (23 sloc) 0.486 kb
# ~/.vim/ftdetect/watchr.vim
#
# This should have only the following line in it:
#
# autocmd BufNewFile,BufRead *.watchr setf ruby
#
# This will enable vim to recognize this file as ruby code should you wish to
# edit it.
def run(cmd)
puts cmd
system cmd
end
def spec(file)
run "spec -O spec/spec.opts #{file}"
end
watch("spec/.*/*_spec\.rb") do |match|
p match[0]
spec(match[0])
end
watch("lib/(.*/.*)\.rb") do |match|
p match[1]
spec("spec/#{match[1]}_spec.rb")
end
Jump to Line
Something went wrong with that request. Please try again.