docs.watchr in watchr-0.5.9 vs docs.watchr in watchr-0.6

- old
+ new

@@ -1,26 +1,26 @@ # Run me with: -# # $ watchr docs.watchr -def run_rdoc - system('rake --silent rdoc') -end +require 'yard' +# -------------------------------------------------- +# Rules +# -------------------------------------------------- +watch( 'lib/.*\.rb' ) { yard } +watch( 'README.md' ) { yard } +watch( 'TODO.md' ) { yard } +watch( 'LICENSE' ) { yard } -def run_yard - print "\nUpdating yardocs... " - system('rake --silent yardoc') - print "done.\n" -end +# -------------------------------------------------- +# Signal Handling +# -------------------------------------------------- +Signal.trap('QUIT') { yard } # Ctrl-\ +Signal.trap('INT' ) { abort("\n") } # Ctrl-C -def document - run_rdoc - run_yard +# -------------------------------------------------- +# Helpers +# -------------------------------------------------- +def yard + print "Updating yardocs... "; STDOUT.flush + YARD::CLI::Yardoc.run *%w( -o doc/yard --readme README.md --markup markdown - LICENSE TODO.md ) + print "done\n" end - -watch( 'lib/.*\.rb' ) { document } -watch( 'README.rdoc' ) { document } -watch( 'TODO.txt' ) { document } -watch( 'LICENSE' ) { document } - - -# vim:ft=ruby