Skip to content

Commit

Permalink
Add documentation generator
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Mar 21, 2012
1 parent 09531d4 commit adf6ce8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
21 changes: 14 additions & 7 deletions Cakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
exec = require('child_process').exec

fs = require "fs"
{exec} = require 'child_process'
fs = require 'fs'

buildFile = (parentPath, dir, file) ->
exec "coffee -o #{parentPath}/#{dir} -c #{parentPath}/src/#{dir}/#{file}", (err, stdout, stderr) ->
Expand All @@ -17,11 +16,19 @@ buildDir = (path) ->
return unless stats.isDirectory()
buildDir "#{path}/#{file}"

task 'build', ->
# deal with errors from child processes
exerr = (err, sout, serr) ->
console.log err if err
console.log sout if sout
console.log serr if serr

task 'build', 'transpile CoffeeScript sources to JavaScript', ->
buildDir "lib"
buildDir "components"
buildDir "bin"

task 'test', ->
exec 'nodeunit test', (err) ->
console.log err if err
task 'test', 'run the unit tests', ->
exec 'npm test', exerr

task 'doc', 'generate documentation for *.coffee files', ->
exec "docco-husky src", exerr
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"devDependencies": {
"nodeunit" : ">=0.6.0",
"coffee-script": ">=1.1.0"
"coffee-script": ">=1.1.0",
"docco-husky": ">=0.3.2"
},
"main": "./lib/NoFlo",
"bin": {
Expand All @@ -35,5 +36,9 @@
},
"scripts": {
"test": "./node_modules/nodeunit/bin/nodeunit test"
},
"docco_husky": {
"output_dir": "docs",
"project_name": "NoFlo"
}
}

0 comments on commit adf6ce8

Please sign in to comment.