l@271: fs = require 'fs' l@271: child = require 'child_process' l@271: l@271: task 'test', 'run tests (requires development install)', (options) -> l@271: process.env['NODE_PATH'] = './lib/:$NODE_PATH' l@271: test = child.spawn 'mocha', ['--compilers', 'coffee:coffee-script/register', '-u', 'tdd', 'test'] l@271: test.stdout.pipe process.stdout l@271: test.stderr.pipe process.stderr l@271: test.on 'exit', (num) -> l@271: return process.exit num l@271: l@271: spawnMochaCov = (reporter) -> l@271: return child.spawn 'mocha', ['--compilers', 'coffee:coffee-script/register', '-r', 'blanket', '-R', reporter, '-u', 'tdd', 'test'] l@271: l@271: task 'coverage', 'run tests with coverage check (requires development install)', (options) -> l@271: process.env['NODE_PATH'] = './lib/:$NODE_PATH' l@271: test = spawnMochaCov 'html-cov' l@271: file = fs.createWriteStream 'coverage.html' l@271: test.stdout.pipe file l@271: test.stderr.pipe process.stderr l@271: test.on 'exit', (num) -> l@271: child.exec 'open ./coverage.html' l@271: l@271: task 'coveralls', 'report coveralls to travis', (options) -> l@271: process.env['NODE_PATH'] = './lib/:$NODE_PATH' l@271: test = spawnMochaCov 'mocha-lcov-reporter' l@271: report = child.spawn './node_modules/coveralls/bin/coveralls.js' l@271: test.stdout.pipe report.stdin l@271: test.stderr.pipe process.stderr l@271: l@271: task 'doc', 'create md and html doc files', (options) -> l@271: child.exec 'coffee -b -c examples/*', -> l@271: child.exec 'docket lib/* examples/* -m', -> l@271: child.exec 'docket lib/* examples/* -d doc_html' l@271: l@271: task 'browserify', 'build for a browser', (options)-> l@271: fs.mkdir './build', -> l@271: child.exec './node_modules/browserify/bin/cmd.js ./lib/index.js --standalone osc -o ./build/osc-min.js', -> l@271: child.exec './node_modules/uglify-js/bin/uglifyjs -o ./build/osc-min.min.js ./build/osc-min.js'