Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better API documentation commands, refs #13

  • Loading branch information...
commit 3ad8fea17e27f7df4714562c4cabaff014128332 1 parent 3560e37
@bergie bergie authored
Showing with 27 additions and 11 deletions.
  1. +22 −8 Cakefile
  2. +4 −2 package.json
  3. +1 −1  test/travis.sh
View
30 Cakefile
@@ -1,5 +1,14 @@
{exec} = require 'child_process'
fs = require 'fs'
+{series} = require 'async'
+
+sh = (command) -> (k) ->
+ console.log "Executing #{command}"
+ exec command, (err, sout, serr) ->
+ console.log err if err
+ console.log sout if sout
+ console.log serr if serr
+ do k
buildFile = (parentPath, dir, file) ->
exec "coffee -o #{parentPath}/#{dir} -c #{parentPath}/src/#{dir}/#{file}", (err, stdout, stderr) ->
@@ -16,19 +25,24 @@ buildDir = (path) ->
return unless stats.isDirectory()
buildDir "#{path}/#{file}"
-# 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', 'run the unit tests', ->
- exec 'npm test', exerr
+ sh('npm test') ->
task 'doc', 'generate documentation for *.coffee files', ->
- exec "docco-husky src", exerr
+ sh('./node_modules/docco-husky/bin/generate src') ->
+
+task 'docpub', 'publish documentation into GitHub pages', ->
+ series [
+ (sh "./node_modules/docco-husky/bin/generate src")
+ (sh "mv docs docs_tmp")
+ (sh "git checkout gh-pages")
+ (sh "cp -R docs_tmp/* docs/")
+ (sh "git add docs/*")
+ (sh "git commit -m 'Documentation update'")
+ (sh "git checkout master")
+ ]
View
6 package.json
@@ -2,9 +2,10 @@
"name": "noflo",
"description": "Flow-Based Programming environment for Node.js",
"keywords": ["fbp", "workflow", "flow"],
- "author": "Henri Bergius",
+ "author": "Henri Bergius <henri.bergius@iki.fi>",
"contributors": [
- "Jerry Jalava"
+ "Jerry Jalava",
+ "Ryan Shaw"
],
"version": "0.0.2",
"licenses": [{
@@ -22,6 +23,7 @@
},
"devDependencies": {
"nodeunit" : ">=0.6.0",
+ "async" : ">=0.1.18",
"coffee-script": ">=1.1.0",
"docco-husky": ">=0.3.2"
},
View
2  test/travis.sh
@@ -1,6 +1,6 @@
#!/bin/bash
npm install -g coffee-script
+npm install --dev
cake build
ln -s `pwd` node_modules/noflo
-
npm install jsdom
Please sign in to comment.
Something went wrong with that request. Please try again.