Permalink
Browse files

Add documentation generator

  • Loading branch information...
bergie committed Mar 21, 2012
1 parent 09531d4 commit adf6ce82ccacd78564aae781cb48066af8fe04d9
Showing with 20 additions and 8 deletions.
  1. +14 −7 Cakefile
  2. +6 −1 package.json
View
@@ -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) ->
@@ -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
View
@@ -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": {
@@ -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.