Skip to content

Commit

Permalink
Add cake docs task to generate annotated source code with docco
Browse files Browse the repository at this point in the history
  • Loading branch information
sstephenson committed Mar 14, 2011
1 parent 7c6e034 commit ac32f06
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Cakefile
@@ -1,3 +1,4 @@
fs = require 'fs'
{print} = require 'sys'
{spawn} = require 'child_process'

Expand All @@ -13,6 +14,14 @@ build = (watch, callback) ->
coffee.stderr.on 'data', (data) -> print data.toString()
coffee.on 'exit', (status) -> callback?() if status is 0

task 'docs', 'Generate annotated source code with Docco', ->
fs.readdir 'src', (err, contents) ->
files = ("src/#{file}" for file in contents when /\.coffee$/.test file)
docco = spawn 'docco', files
docco.stdout.on 'data', (data) -> print data.toString()
docco.stderr.on 'data', (data) -> print data.toString()
docco.on 'exit', (status) -> callback?() if status is 0

task 'build', 'Compile CoffeeScript source files', ->
build()

Expand Down

0 comments on commit ac32f06

Please sign in to comment.