-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocs.watchr
More file actions
25 lines (21 loc) · 725 Bytes
/
docs.watchr
File metadata and controls
25 lines (21 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Run me with:
# $ watchr docs.watchr
require 'yard'
# --------------------------------------------------
# Rules
# --------------------------------------------------
watch( 'lib/.*\.rb' ) { yard }
watch( 'README.md' ) { yard }
# --------------------------------------------------
# Signal Handling
# --------------------------------------------------
Signal.trap('QUIT') { yard } # Ctrl-\
Signal.trap('INT' ) { abort("\n") } # Ctrl-C
# --------------------------------------------------
# Helpers
# --------------------------------------------------
def yard
print "Updating yardocs... "; STDOUT.flush
YARD::CLI::Yardoc.run *%w( --no-private -o doc/yard --readme README.md - LICENSE )
print "done\n"
end