fsp
Version:
A minimal `fs` that returns A+ promises (when). For each `fs.xxx` function, it adds an `fs.xxxP` returning promises.
26 lines (22 loc) • 850 B
text/coffeescript
module.exports = gruntFunction = (grunt) ->
gruntConfig =
urequire:
_all:
template:
name: 'nodejs'
banner: true
lib:
path: 'source/code'
dstPath: 'build/code'
spec:
path: 'source/spec'
dstPath: 'build/spec'
afterBuild: require('urequire-ab-specrunner')
specWatch: derive: 'spec', watch: true
splitTasks = (tasks)-> if (tasks instanceof Array) then tasks else tasks.split(/\s/).filter((f)->!!f)
grunt.registerTask shortCut, "urequire:#{shortCut}" for shortCut of gruntConfig.urequire
grunt.registerTask shortCut, splitTasks tasks for shortCut, tasks of {
default: 'lib spec'
}
grunt.loadNpmTasks task for task of grunt.file.readJSON('package.json').devDependencies when task.lastIndexOf('grunt-', 0) is 0
grunt.initConfig gruntConfig