Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (20 sloc) 676 Bytes
task 'test', 'Run the test suite', ->
require('nodeunit') ['./test']
task 'docs', 'Generate annotated source code with Docco', ->
async = require 'async'
fs = require 'fs'
{print} = require 'util'
{exec} = require 'child_process'
genDocs = (root) ->
fs.readdir root, (err, paths) ->
async.forEach paths,
(path, cb) ->
fs.stat "#{root}/#{path}", (err, stat) ->
if stat?.isDirectory()
genDocs "#{root}/#{path}"
else if /\.coffee$/.test path
exec "docco #{root}/#{path}"
(err) ->
console.error err if err?
genDocs 'lib'