Browse files

Update docs.watchr script

  • Loading branch information...
1 parent f677874 commit a65c9bc9b1351216ab7e2755555c6d7d148e5612 @mynyml mynyml committed Feb 9, 2010
Showing with 20 additions and 20 deletions.
  1. +20 −20 docs.watchr
View
40 docs.watchr
@@ -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.rdoc' ) { yard }
+watch( 'TODO.txt' ) { 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.rdoc --markup rdoc - LICENSE TODO.txt )
+ print "done\n"
end
-
-watch( 'lib/.*\.rb' ) { document }
-watch( 'README.rdoc' ) { document }
-watch( 'TODO.txt' ) { document }
-watch( 'LICENSE' ) { document }
-
-
-# vim:ft=ruby

0 comments on commit a65c9bc

Please sign in to comment.