diff --git a/Jake/templates/package.json.tmpl b/Jake/templates/package.json.tmpl index 909b906c..46900d9f 100644 --- a/Jake/templates/package.json.tmpl +++ b/Jake/templates/package.json.tmpl @@ -18,31 +18,36 @@ ], "dependencies": { "markdown": "0.4.0", - "taffydb": "git://github.com/hegemonic/taffydb.git" + "taffydb": "git://github.com/hegemonic/taffydb.git", + "wrench": "1.3.9" }, "bugs": "https://github.com/jsdoc3/jsdoc/issues", "contributors" : [ - { + { "name": "Michael Mathews", "email": "micmath@gmail.com" }, - { + { "name": "Rafa\u0105 Wrzeszcz", "email": "rafal.wrzeszcz@wrzasq.pl" }, - { - "name": "Jannon Frank", - "email": "jannon@jannon.net" - } - ], + { + "name": "Jannon Frank", + "email": "jannon@jannon.net" + } + ], "maintainers": [ { "name": "Michael Mathews", "email": "micmath@gmail.com" }, - { - "name": "Jannon Frank", - "email": "jannon@jannon.net" - } - ] + { + "name": "Jannon Frank", + "email": "jannon@jannon.net" + }, + { + "name": "Jeff Williams", + "email": "jeffrey.l.williams@gmail.com" + } + ] } diff --git a/Jakefile.js b/Jakefile.js index 124b8ea3..03866842 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -30,7 +30,7 @@ task('default', [], function(params) { desc('Installs a plugin/template.'); task('install', [], function(loc) { - var fs = require('fs'), util = require('util'), path = require('path'), wrench = require('wrench/wrench'); + var fs = require('fs'), util = require('util'), path = require('path'), wrench = require('wrench'); if(!loc) { fail("You must specify the location of the plugin/template."); diff --git a/node_modules/wrench/LICENSE b/node_modules/wrench/LICENSE new file mode 100644 index 00000000..a85a94a6 --- /dev/null +++ b/node_modules/wrench/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2010 Ryan McGrath + +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. diff --git a/nodejs_modules/wrench/wrench.js b/node_modules/wrench/lib/wrench.js similarity index 98% rename from nodejs_modules/wrench/wrench.js rename to node_modules/wrench/lib/wrench.js index 7cf90892..00f4166b 100644 --- a/nodejs_modules/wrench/wrench.js +++ b/node_modules/wrench/lib/wrench.js @@ -49,7 +49,7 @@ exports.readdirSyncRecursive = function(baseDir) { // convert absolute paths to relative var fileList = readdirSyncRecursive(baseDir).map(function(val){ - return val.replace(/\\/g, '/').replace(baseDir + '/', ''); + return _path.relative(baseDir, val); }); return fileList; @@ -106,7 +106,7 @@ exports.readdirRecursive = function(baseDir, fn) { fn(null, curFiles.map(function(val) { // convert absolute paths to relative - return val.replace(baseDir + '/', ''); + return _path.relative(baseDir, val); })); if (waitCount == 0) { @@ -368,9 +368,12 @@ exports.LineReader.prototype = { var res = fs.readSync(this.fd, this.bufferSize, position, "ascii"); this.buffer += res[0]; - if(res[1] === 0) return -1; + if(res[1] === 0) { + this.currentPosition = -1; + } else { + this.currentPosition = position + res[1]; + } - this.currentPosition = position + res[1]; return this.currentPosition; }, @@ -378,7 +381,6 @@ exports.LineReader.prototype = { while(this.buffer.indexOf('\n') === -1) { this.getBufferAndSetCurrentPosition(this.currentPosition); if(this.currentPosition === -1) return false; - if(this.buffer.length === 0) return false; } if(this.buffer.indexOf("\n") > -1) return true; diff --git a/node_modules/wrench/package.json b/node_modules/wrench/package.json new file mode 100644 index 00000000..7c426e76 --- /dev/null +++ b/node_modules/wrench/package.json @@ -0,0 +1,39 @@ +{ + "name": "wrench", + "description": "Recursive filesystem (and other) operations that Node *should* have.", + "version": "1.3.9", + "author": { + "name": "Ryan McGrath", + "email": "ryan@venodesigns.net" + }, + "repository": { + "type": "git", + "url": "https://ryanmcgrath@github.com/ryanmcgrath/wrench-js.git" + }, + "bugs": { + "url": "http://github.com/ryanmcgrath/wrench-js/issues" + }, + "directories": { + "lib": "./lib/" + }, + "dependencies": {}, + "devDependencies": { + "nodeunit": ">= 0.6.4" + }, + "main": "./lib/wrench", + "engines": { + "node": ">=0.1.97" + }, + "scripts": { + "test": "nodeunit tests/runner.js" + }, + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/ryanmcgrath/wrench-js/raw/master/LICENSE" + } + ], + "readme": "wrench.js - Recursive file operations in Node.js\n----------------------------------------------------------------------------\nWhile I love Node.js, I've found myself missing some functions. Things like\nrecursively deleting/chmodding a directory (or even deep copying a directory),\nor even a basic line reader, shouldn't need to be re-invented time and time again.\n\nThat said, here's my attempt at a re-usable solution, at least until something\nmore formalized gets integrated into Node.js (*hint hint*). wrench.js is fairly simple\nto use - check out the documentation/examples below:\n\nInstallation\n-----------------------------------------------------------------------------\n\n npm install wrench\n\nUsage\n-----------------------------------------------------------------------------\n``` javascript\nvar wrench = require('wrench'),\n\tutil = require('util');\n```\n\n### Synchronous operations\n``` javascript\n// Recursively create directories, sub-trees and all.\nwrench.mkdirSyncRecursive(dir, 0777);\n\n// Recursively delete the entire sub-tree of a directory, then kill the directory\nwrench.rmdirSyncRecursive('my_directory_name', failSilently);\n\n// Recursively read directories contents.\nwrench.readdirSyncRecursive('my_directory_name');\n\n// Recursively chmod the entire sub-tree of a directory\nwrench.chmodSyncRecursive('my_directory_name', 0755);\n\n// Recursively chown the entire sub-tree of a directory\nwrench.chownSyncRecursive(\"directory\", uid, gid);\n\n// Deep-copy an existing directory\nwrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up');\n\n// Read lines in from a file until you hit the end\nvar f = new wrench.LineReader('x.txt');\nwhile(f.hasNextLine()) {\n\tutil.puts(x.getNextLine());\n}\n```\n\n### Asynchronous operations\n``` javascript\n// Recursively read directories contents\nvar files = [];\nwrench.readdirRecursive('my_directory_name', function(error, curFiles) {\n // curFiles is what you want\n});\n\n```\n\nQuestions, comments? Hit me up. (ryan [at] venodesigns.net | http://twitter.com/ryanmcgrath)\n", + "_id": "wrench@1.3.9", + "_from": "wrench" +} diff --git a/package.json b/package.json index 58770af4..7c71c000 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "JSDoc", "version": "3.0.0", - "revision": "1350303594542", + "revision": "1350306006277", "description": "An automatic documentation generator for javascript.", "keywords": [ "documentation", "javascript" ], "licenses": [ @@ -18,31 +18,36 @@ ], "dependencies": { "markdown": "0.4.0", - "taffydb": "git://github.com/hegemonic/taffydb.git" + "taffydb": "git://github.com/hegemonic/taffydb.git", + "wrench": "1.3.9" }, "bugs": "https://github.com/jsdoc3/jsdoc/issues", "contributors" : [ - { + { "name": "Michael Mathews", "email": "micmath@gmail.com" }, - { + { "name": "Rafa\u0105 Wrzeszcz", "email": "rafal.wrzeszcz@wrzasq.pl" }, - { - "name": "Jannon Frank", - "email": "jannon@jannon.net" - } - ], + { + "name": "Jannon Frank", + "email": "jannon@jannon.net" + } + ], "maintainers": [ { "name": "Michael Mathews", "email": "micmath@gmail.com" }, - { - "name": "Jannon Frank", - "email": "jannon@jannon.net" - } - ] + { + "name": "Jannon Frank", + "email": "jannon@jannon.net" + }, + { + "name": "Jeff Williams", + "email": "jeffrey.l.williams@gmail.com" + } + ] } \ No newline at end of file diff --git a/test/spec-collection.js b/test/spec-collection.js index d18ed196..6cf0dcae 100644 --- a/test/spec-collection.js +++ b/test/spec-collection.js @@ -1,5 +1,5 @@ /*global env: true */ -var wrench = require('wrench/wrench'); +var wrench = require('wrench'); var path = require('path'); var fs = require('fs'); var specs = [];