forked from awnist/confurg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
38 lines (30 loc) · 913 Bytes
/
Gruntfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
path = require 'path'
exports = module.exports = (grunt) ->
grunt.initConfig
mochacli:
options:
reporter: 'spec'
compilers: ['coffee:coffee-script']
'ignore-leaks': true
all: ['test/unit/*.spec.coffee']
clean:
src: ['docs']
docs:
all:
src: ['README.md', './src/confurg.coffee']
grunt.loadNpmTasks 'grunt-mocha-cli'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.registerTask 'test', ['mochacli']
# Generate documentation
grunt.registerMultiTask 'docs', 'Generate documentation', ->
done = @async()
child = grunt.util.spawn {
cmd: './node_modules/.bin/docco'
grunt: false
args: @filesSrc
}, (error, result, code) ->
grunt.log.ok 'Generated documentation at ./docs/'
done()
child.stdout.pipe process.stdout
child.stderr.pipe process.stderr
grunt.registerTask 'doc', ['docs']