node-postgres/watch.rb

14 lines
232 B
Ruby
Raw Normal View History

2010-09-30 12:35:14 +08:00
#watch file
2010-10-03 13:53:25 +08:00
def run_test_file(f)
puts "running #{f}"
system "node #{f}"
puts "done"
2010-09-30 13:36:11 +08:00
end
2010-09-30 12:35:14 +08:00
watch('lib/(.*)\.js') { |md|
2010-10-03 13:53:25 +08:00
puts Dir["test/*.js"].each { |f| run_test_file(f) }
2010-09-30 12:35:14 +08:00
}
watch('test/(.*)\.js') { |md|
2010-10-03 13:53:25 +08:00
run_test_file(md)
2010-09-30 12:35:14 +08:00
}