Write to docs/output/api.json

This commit is contained in:
Kevin Sawicki
2014-08-19 17:52:12 -06:00
committed by Ben Ogle
parent 1bc879a9b0
commit cfc965c135
2 changed files with 5 additions and 20 deletions

View File

@@ -130,7 +130,7 @@ module.exports = (grunt) ->
atom: {appDir, appName, symbolsDir, buildDir, contentsDir, installDir, shellAppDir}
docsOutputDir: 'docs/api'
docsOutputDir: 'docs/output'
coffee: coffeeConfig

View File

@@ -9,10 +9,6 @@ donna = require 'donna'
tello = require 'tello'
module.exports = (grunt) ->
{rm} = require('./task-helpers')(grunt)
opts = stdio: 'inherit'
getClassesToInclude = ->
modulesPath = path.resolve(__dirname, '..', '..', 'node_modules')
classes = {}
@@ -31,18 +27,7 @@ module.exports = (grunt) ->
docsOutputDir = grunt.config.get('docsOutputDir')
metadata = donna.generateMetadata(['.'])
telloJson = _.extend(tello.digest(metadata), getClassesToInclude())
files = [{
filePath: path.join(docsOutputDir, 'donna.json')
contents: JSON.stringify(metadata, null, ' ')
}, {
filePath: path.join(docsOutputDir, 'tello.json')
contents: JSON.stringify(telloJson, null, ' ')
}]
writeFile = ({filePath, contents}, callback) ->
fs.writeFile filePath, contents, (error) ->
callback(error)
async.map files, writeFile, -> done()
api = _.extend(tello.digest(metadata), getClassesToInclude())
apiJson = JSON.stringify(api, null, 2)
apiJsonPath = path.join(docsOutputDir, 'api.json')
grunt.file.write(apiJsonPath, apiJson)