Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Inital commit

  • Loading branch information...
commit 5ba63a0fdced0cec0a8ab327281bea55fb3e3ac4 0 parents
@mattmcmanus mattmcmanus authored
1  .gitignore
@@ -0,0 +1 @@
+/node_modules/
1  .npmignore
@@ -0,0 +1 @@
+/node_modules/
22 LICENSE-MIT
@@ -0,0 +1,22 @@
+Copyright (c) 2012 Matt McManus
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
28 README.md
@@ -0,0 +1,28 @@
+# grunt-dox
+
+Dox grunt plugin
+
+## Getting Started
+Install this grunt plugin next to your project's [grunt.js gruntfile][getting_started] with: `npm install grunt-dox`
+
+Then add this line to your project's `grunt.js` gruntfile:
+
+```javascript
+grunt.loadNpmTasks('grunt-dox');
+```
+
+[grunt]: https://github.com/cowboy/grunt
+[getting_started]: https://github.com/cowboy/grunt/blob/master/docs/getting_started.md
+
+## Documentation
+_(Coming soon)_
+
+## Contributing
+In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt][grunt].
+
+## Release History
+_(Nothing yet)_
+
+## License
+Copyright (c) 2012 Matt McManus
+Licensed under the MIT license.
2  bin/grunt-dox
@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+require('grunt').npmTasks('grunt-dox').cli();
40 grunt.js
@@ -0,0 +1,40 @@
+module.exports = function(grunt) {
+
+ // Project configuration.
+ grunt.initConfig({
+ test: {
+ files: ['test/**/*.js']
+ },
+ lint: {
+ files: ['grunt.js', 'tasks/**/*.js', 'test/**/*.js']
+ },
+ watch: {
+ files: '<config:lint.files>',
+ tasks: 'default'
+ },
+ jshint: {
+ options: {
+ curly: true,
+ eqeqeq: true,
+ immed: true,
+ latedef: true,
+ newcap: true,
+ noarg: true,
+ sub: true,
+ undef: true,
+ boss: true,
+ eqnull: true,
+ node: true,
+ es5: true
+ },
+ globals: {}
+ }
+ });
+
+ // Load local tasks.
+ grunt.loadTasks('tasks');
+
+ // Default task.
+ grunt.registerTask('default', 'lint test');
+
+};
41 package.json
@@ -0,0 +1,41 @@
+{
+ "name": "grunt-dox",
+ "description": "Dox grunt plugin",
+ "version": "0.0.0",
+ "homepage": "https://github.com/mattmcmanus/grunt-dox",
+ "author": {
+ "name": "Matt McManus",
+ "email": "mcmanus@punkave.com"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/punkave/grunt-dox.git"
+ },
+ "bugs": {
+ "url": "https://github.com/punkave/grunt-dox/issues"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://github.com/punkave/grunt-dox/blob/master/LICENSE-MIT"
+ }
+ ],
+ "main": "grunt.js",
+ "bin": "bin/grunt-dox",
+ "engines": {
+ "node": "*"
+ },
+ "scripts": {
+ "test": "grunt test"
+ },
+ "dependencies": {
+ "dox": "*",
+ "dox-template": "*"
+ },
+ "devDependencies": {
+ "grunt": "~0.3.15"
+ },
+ "keywords": [
+ "gruntplugin"
+ ]
+}
44 tasks/dox.js
@@ -0,0 +1,44 @@
+/*
+ * grunt-dox
+ * https://github.com/mattmcmanus/grunt-dox
+ *
+ * Copyright (c) 2012 Matt McManus
+ * Licensed under the MIT license.
+ */
+
+var exec = require('child_process').exec;
+
+var fs = require('fs');
+
+module.exports = function(grunt) {
+
+ // Please see the grunt documentation for more information regarding task and
+ // helper creation: https://github.com/cowboy/grunt/blob/master/docs/toc.md
+
+ // ==========================================================================
+ // TASKS
+ // ==========================================================================
+
+ grunt.registerMultiTask('dox', 'Generate dox output ', function() {
+
+ var filesSrc = grunt.file.expandFiles(this.file.src),
+ dest = this.file.dest;
+ //done = this.async();
+
+ var files = filesSrc.map(function(file){
+ return { src: file, dest: dest + file.replace(/\.js/,".json")}
+ })
+
+ grunt.utils.async.forEach( files,
+ function dox(file, callback){
+ exec('dox < ' + file.src, function(error, stout, sterr){
+ grunt.file.write(file.dest, stout);
+ grunt.log.writeln('File "' + file.src + '" doxxed.');
+ if (!error) callback()
+ })
+ },
+ function(err){
+ done();
+ })
+ });
+};
34 test/dox_test.js
@@ -0,0 +1,34 @@
+var grunt = require('grunt');
+
+/*
+ ======== A Handy Little Nodeunit Reference ========
+ https://github.com/caolan/nodeunit
+
+ Test methods:
+ test.expect(numAssertions)
+ test.done()
+ Test assertions:
+ test.ok(value, [message])
+ test.equal(actual, expected, [message])
+ test.notEqual(actual, expected, [message])
+ test.deepEqual(actual, expected, [message])
+ test.notDeepEqual(actual, expected, [message])
+ test.strictEqual(actual, expected, [message])
+ test.notStrictEqual(actual, expected, [message])
+ test.throws(block, [error], [message])
+ test.doesNotThrow(block, [error], [message])
+ test.ifError(value)
+*/
+
+exports['dox'] = {
+ setUp: function(done) {
+ // setup here
+ done();
+ },
+ 'helper': function(test) {
+ test.expect(1);
+ // tests here
+ test.equal(grunt.helper('dox'), 'dox!!!', 'should return the correct value.');
+ test.done();
+ }
+};

0 comments on commit 5ba63a0

Please sign in to comment.
Something went wrong with that request. Please try again.