Changeset 516 for Dev/trunk/node_modules/grunt
- Timestamp:
- 03/14/14 12:36:58 (11 years ago)
- Location:
- Dev/trunk
- Files:
-
- 21 added
- 4 deleted
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk
- Property svn:ignore
-
old new 1 1 build 2 quod-erat.git
-
- Property svn:ignore
-
Dev/trunk/node_modules/grunt/.npmignore
r484 r516 4 4 AUTHORS 5 5 CHANGELOG 6 CONTRIBUTING. MD6 CONTRIBUTING.md 7 7 custom-gruntfile.js 8 8 Gruntfile.js -
Dev/trunk/node_modules/grunt/LICENSE-MIT
r484 r516 1 Copyright (c) 201 3"Cowboy" Ben Alman1 Copyright (c) 2014 "Cowboy" Ben Alman 2 2 3 3 Permission is hereby granted, free of charge, to any person -
Dev/trunk/node_modules/grunt/README.md
r484 r516 1 # Grunt: The JavaScript Task Runner [](http://travis-ci.org/gruntjs/grunt) 1 # Grunt: The JavaScript Task Runner 2 3 [](http://travis-ci.org/gruntjs/grunt) 4 [](http://gruntjs.com/) 2 5 3 6 <img align="right" height="260" src="http://gruntjs.com/img/grunt-logo-no-wordmark.svg"> -
Dev/trunk/node_modules/grunt/internal-tasks/bump.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman, contributors5 * Copyright (c) 2014 "Cowboy" Ben Alman, contributors 6 6 * Licensed under the MIT license. 7 7 */ -
Dev/trunk/node_modules/grunt/internal-tasks/subgrunt.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman5 * Copyright (c) 2014 "Cowboy" Ben Alman 6 6 * Licensed under the MIT license. 7 7 * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT -
Dev/trunk/node_modules/grunt/lib/grunt.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman5 * Copyright (c) 2014 "Cowboy" Ben Alman 6 6 * Licensed under the MIT license. 7 7 * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT … … 23 23 return grunt[name] = require('./grunt/' + name); 24 24 } 25 var util = gRequire('util'); 25 26 var util = require('grunt-legacy-util'); 27 grunt.util = util; 28 grunt.util.task = require('./util/task'); 29 26 30 gRequire('template'); 27 31 gRequire('event'); … … 153 157 // allows the error callback to execute multiple times. 154 158 tasks.forEach(function(name) { task.run(name); }); 155 task.start(); 159 // Run tasks async internally to reduce call-stack, per: 160 // https://github.com/gruntjs/grunt/pull/1026 161 task.start({asyncDone:true}); 156 162 }; -
Dev/trunk/node_modules/grunt/lib/grunt/cli.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman5 * Copyright (c) 2014 "Cowboy" Ben Alman 6 6 * Licensed under the MIT license. 7 7 * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT … … 22 22 // CLI-parsed options override any passed-in "default" options. 23 23 if (options) { 24 // For each def ult option...24 // For each default option... 25 25 Object.keys(options).forEach(function(key) { 26 26 if (!(key in cli.options)) { … … 62 62 short: 'd', 63 63 info: 'Enable debugging mode for tasks that support it.', 64 type: Number64 type: [Number, Boolean] 65 65 }, 66 66 stack: { -
Dev/trunk/node_modules/grunt/lib/grunt/config.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman5 * Copyright (c) 2014 "Cowboy" Ben Alman 6 6 * Licensed under the MIT license. 7 7 * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT -
Dev/trunk/node_modules/grunt/lib/grunt/event.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman5 * Copyright (c) 2014 "Cowboy" Ben Alman 6 6 * Licensed under the MIT license. 7 7 * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT -
Dev/trunk/node_modules/grunt/lib/grunt/fail.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman5 * Copyright (c) 2014 "Cowboy" Ben Alman 6 6 * Licensed under the MIT license. 7 7 * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT -
Dev/trunk/node_modules/grunt/lib/grunt/file.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman5 * Copyright (c) 2014 "Cowboy" Ben Alman 6 6 * Licensed under the MIT license. 7 7 * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT … … 134 134 var pathSeparatorRe = /[\/\\]/g; 135 135 136 // The "ext" option refers to either everything after the first dot (default) 137 // or everything after the last dot. 138 var extDotRe = { 139 first: /(\.[^\/]*)?$/, 140 last: /(\.[^\/\.]*)?$/, 141 }; 142 136 143 // Build a multi task "files" object dynamically. 137 144 file.expandMapping = function(patterns, destBase, options) { 138 145 options = grunt.util._.defaults({}, options, { 146 extDot: 'first', 139 147 rename: function(destBase, destPath) { 140 148 return path.join(destBase || '', destPath); … … 151 159 } 152 160 // Change the extension? 153 if ( options.ext) {154 destPath = destPath.replace( /(\.[^\/]*)?$/, options.ext);161 if ('ext' in options) { 162 destPath = destPath.replace(extDotRe[options.extDot], options.ext); 155 163 } 156 164 // Generate destination filename. -
Dev/trunk/node_modules/grunt/lib/grunt/help.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman5 * Copyright (c) 2014 "Cowboy" Ben Alman 6 6 * Licensed under the MIT license. 7 7 * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT -
Dev/trunk/node_modules/grunt/lib/grunt/log.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman5 * Copyright (c) 2014 "Cowboy" Ben Alman 6 6 * Licensed under the MIT license. 7 7 * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT -
Dev/trunk/node_modules/grunt/lib/grunt/option.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman5 * Copyright (c) 2014 "Cowboy" Ben Alman 6 6 * Licensed under the MIT license. 7 7 * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT -
Dev/trunk/node_modules/grunt/lib/grunt/task.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman5 * Copyright (c) 2014 "Cowboy" Ben Alman 6 6 * Licensed under the MIT license. 7 7 * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT … … 108 108 } 109 109 } else if (Array.isArray(data.files)) { 110 data.files.forEach(function(obj) {110 grunt.util._.flatten(data.files).forEach(function(obj) { 111 111 var prop; 112 112 if ('src' in obj || 'dest' in obj) { … … 245 245 return options; 246 246 }; 247 // Expose the current target. 248 this.target = target; 249 // Recreate flags object so that the target isn't set as a flag. 250 this.flags = {}; 251 this.args.forEach(function(arg) { this.flags[arg] = true; }, this); 247 252 // Expose data on `this` (as well as task.current). 248 253 this.data = grunt.config([name, target]); … … 256 261 }.bind(this) 257 262 }); 258 // Expose the current target.259 this.target = target;260 // Recreate flags object so that the target isn't set as a flag.261 this.flags = {};262 this.args.forEach(function(arg) { this.flags[arg] = true; }, this);263 263 // Call original task function, passing in the target and any other args. 264 264 return fn.apply(this, this.args); … … 278 278 // Override built-in renameTask to use the registry. 279 279 task.renameTask = function(oldname, newname) { 280 // Add and remove task. 281 registry.untasks.push(oldname); 282 registry.tasks.push(newname); 283 // Actually rename task. 284 return parent.renameTask.apply(task, arguments); 280 var result; 281 try { 282 // Actually rename task. 283 result = parent.renameTask.apply(task, arguments); 284 // Add and remove task. 285 registry.untasks.push(oldname); 286 registry.tasks.push(newname); 287 // Return result. 288 return result; 289 } catch(e) { 290 grunt.log.error(e.message); 291 } 285 292 }; 286 293 -
Dev/trunk/node_modules/grunt/lib/grunt/template.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman5 * Copyright (c) 2014 "Cowboy" Ben Alman 6 6 * Licensed under the MIT license. 7 7 * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT -
Dev/trunk/node_modules/grunt/lib/util/task.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman5 * Copyright (c) 2014 "Cowboy" Ben Alman 6 6 * Licensed under the MIT license. 7 7 * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT … … 90 90 // easier to implement than some kind of in-task "super" functionality. 91 91 Task.prototype.renameTask = function(oldname, newname) { 92 if (!this._tasks[oldname]) { 93 throw new Error('Cannot rename missing "' + oldname + '" task.'); 94 } 92 95 // Rename task. 93 96 this._tasks[newname] = this._tasks[oldname]; … … 186 189 187 190 // Run a task function, handling this.async / return value. 188 Task.prototype.runTaskFn = function(context, fn, done ) {191 Task.prototype.runTaskFn = function(context, fn, done, asyncDone) { 189 192 // Async flag. 190 193 var async = false; … … 213 216 this._options.error.call({name: context.name, nameArgs: context.nameArgs}, err); 214 217 } 215 done(err, success); 218 // only call done async if explicitly requested to 219 // see: https://github.com/gruntjs/grunt/pull/1026 220 if (asyncDone) { 221 process.nextTick(function () { 222 done(err, success); 223 }); 224 } else { 225 done(err, success); 226 } 216 227 }.bind(this); 217 228 … … 244 255 245 256 // Begin task queue processing. Ie. run all tasks. 246 Task.prototype.start = function() { 257 Task.prototype.start = function(opts) { 258 if (!opts) { 259 opts = {}; 260 } 247 261 // Abort if already running. 248 262 if (this._running) { return false; } … … 281 295 this.runTaskFn(context, function() { 282 296 return thing.task.fn.apply(this, this.args); 283 }, nextTask );297 }, nextTask, !!opts.asyncDone); 284 298 285 299 }.bind(this); -
Dev/trunk/node_modules/grunt/node_modules/colors/package.json
r484 r516 26 26 "readmeFilename": "ReadMe.md", 27 27 "_id": "colors@0.6.2", 28 "dist": { 29 "shasum": "57915cf80820c121e254ec8b7819ab808d2beae5" 30 }, 31 "_from": "colors@~0.6.2", 32 "_resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", 33 "scripts": {} 28 "_from": "colors@~0.6.2" 34 29 } -
Dev/trunk/node_modules/grunt/node_modules/eventemitter2/package.json
r484 r516 59 59 "homepage": "https://github.com/hij1nx/EventEmitter2", 60 60 "_id": "eventemitter2@0.4.13", 61 "dist": { 62 "shasum": "2a03bdff50bda6586cf2e27c71feeaf6d37c383c" 63 }, 64 "_from": "eventemitter2@~0.4.13", 65 "_resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.13.tgz" 61 "_from": "eventemitter2@~0.4.13" 66 62 } -
Dev/trunk/node_modules/grunt/node_modules/exit/package.json
r484 r516 48 48 "readmeFilename": "README.md", 49 49 "_id": "exit@0.1.2", 50 "dist": { 51 "shasum": "2a1f6b7dd67aedcf9544e948cc817113b64012a5" 52 }, 53 "_from": "exit@~0.1.1", 54 "_resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" 50 "_from": "exit@~0.1.1" 55 51 } -
Dev/trunk/node_modules/grunt/node_modules/getobject/package.json
r484 r516 45 45 "readmeFilename": "README.md", 46 46 "_id": "getobject@0.1.0", 47 "dist": { 48 "shasum": "4563bd9ebffaa0790ee7eec6e2d74523b7e852a6" 49 }, 50 "_from": "getobject@~0.1.0", 51 "_resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz" 47 "_from": "getobject@~0.1.0" 52 48 } -
Dev/trunk/node_modules/grunt/node_modules/glob/node_modules/inherits/package.json
r484 r516 27 27 "homepage": "https://github.com/isaacs/inherits", 28 28 "_id": "inherits@1.0.0", 29 "dist": {30 "shasum": "26467026b3b86de1c6f72f00d9a31b1c97077a92"31 },32 29 "_from": "inherits@1", 33 " _resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz"30 "scripts": {} 34 31 } -
Dev/trunk/node_modules/grunt/node_modules/iconv-lite/package.json
r484 r516 77 77 }, 78 78 "_id": "iconv-lite@0.2.11", 79 "dist": { 80 "shasum": "1827821f46962889765690b557c045f5cc3976eb" 81 }, 82 "_from": "iconv-lite@~0.2.11", 83 "_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz" 79 "_from": "iconv-lite@~0.2.11" 84 80 } -
Dev/trunk/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json
r484 r516 70 70 "readmeFilename": "README.markdown", 71 71 "_id": "underscore.string@2.3.3", 72 "dist": { 73 "shasum": "a7cea3b9aa84d24cf1363ccbddd02ee10abee0c0" 74 }, 75 "_from": "underscore.string@~2.3.1", 76 "_resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz" 72 "_from": "underscore.string@~2.3.1" 77 73 } -
Dev/trunk/node_modules/grunt/node_modules/minimatch/README.md
r484 r516 20 20 minimatch("bar.foo", "*.foo") // true! 21 21 minimatch("bar.foo", "*.bar") // false! 22 minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! 22 23 ``` 23 24 … … 36 37 * `man 3 fnmatch` 37 38 * `man 5 gitignore` 38 39 ### Comparisons to other fnmatch/glob implementations40 41 While strict compliance with the existing standards is a worthwhile42 goal, some discrepancies exist between minimatch and other43 implementations, and are intentional.44 45 If the pattern starts with a `!` character, then it is negated. Set the46 `nonegate` flag to suppress this behavior, and treat leading `!`47 characters normally. This is perhaps relevant if you wish to start the48 pattern with a negative extglob pattern like `!(a|B)`. Multiple `!`49 characters at the start of a pattern will negate the pattern multiple50 times.51 52 If a pattern starts with `#`, then it is treated as a comment, and53 will not match anything. Use `\#` to match a literal `#` at the54 start of a line, or set the `nocomment` flag to suppress this behavior.55 56 The double-star character `**` is supported by default, unless the57 `noglobstar` flag is set. This is supported in the manner of bsdglob58 and bash 4.1, where `**` only has special significance if it is the only59 thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but60 `a/**b` will not. **Note that this is different from the way that `**` is61 handled by ruby's `Dir` class.**62 63 If an escaped pattern has no matches, and the `nonull` flag is set,64 then minimatch.match returns the pattern as-provided, rather than65 interpreting the character escapes. For example,66 `minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than67 `"*a?"`. This is akin to setting the `nullglob` option in bash, except68 that it does not resolve escaped pattern characters.69 70 If brace expansion is not disabled, then it is performed before any71 other interpretation of the glob pattern. Thus, a pattern like72 `+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded73 **first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are74 checked for validity. Since those two are valid, matching proceeds.75 76 39 77 40 ## Minimatch Class … … 217 180 Returns from negate expressions the same as if they were not negated. 218 181 (Ie, true on a hit, false on a miss.) 182 183 184 ## Comparisons to other fnmatch/glob implementations 185 186 While strict compliance with the existing standards is a worthwhile 187 goal, some discrepancies exist between minimatch and other 188 implementations, and are intentional. 189 190 If the pattern starts with a `!` character, then it is negated. Set the 191 `nonegate` flag to suppress this behavior, and treat leading `!` 192 characters normally. This is perhaps relevant if you wish to start the 193 pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` 194 characters at the start of a pattern will negate the pattern multiple 195 times. 196 197 If a pattern starts with `#`, then it is treated as a comment, and 198 will not match anything. Use `\#` to match a literal `#` at the 199 start of a line, or set the `nocomment` flag to suppress this behavior. 200 201 The double-star character `**` is supported by default, unless the 202 `noglobstar` flag is set. This is supported in the manner of bsdglob 203 and bash 4.1, where `**` only has special significance if it is the only 204 thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but 205 `a/**b` will not. 206 207 If an escaped pattern has no matches, and the `nonull` flag is set, 208 then minimatch.match returns the pattern as-provided, rather than 209 interpreting the character escapes. For example, 210 `minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than 211 `"*a?"`. This is akin to setting the `nullglob` option in bash, except 212 that it does not resolve escaped pattern characters. 213 214 If brace expansion is not disabled, then it is performed before any 215 other interpretation of the glob pattern. Thus, a pattern like 216 `+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded 217 **first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are 218 checked for validity. Since those two are valid, matching proceeds. -
Dev/trunk/node_modules/grunt/node_modules/minimatch/minimatch.js
r484 r516 69 69 var slashSplit = /\/+/ 70 70 71 minimatch.monkeyPatch = monkeyPatch72 function monkeyPatch () {73 var desc = Object.getOwnPropertyDescriptor(String.prototype, "match")74 var orig = desc.value75 desc.value = function (p) {76 if (p instanceof Minimatch) return p.match(this)77 return orig.call(this, p)78 }79 Object.defineProperty(String.prototype, desc)80 }81 82 71 minimatch.filter = filter 83 72 function filter (pattern, options) { … … 179 168 } 180 169 170 Minimatch.prototype.debug = function() {} 171 181 172 Minimatch.prototype.make = make 182 173 function make () { … … 203 194 var set = this.globSet = this.braceExpand() 204 195 205 if (options.debug) console.error(this.pattern, set) 196 if (options.debug) this.debug = console.error 197 198 this.debug(this.pattern, set) 206 199 207 200 // step 3: now we have a set, so turn each one into a series of path-portion … … 214 207 }) 215 208 216 if (options.debug) console.error(this.pattern, set)209 this.debug(this.pattern, set) 217 210 218 211 // glob --> regexps … … 221 214 }, this) 222 215 223 if (options.debug) console.error(this.pattern, set)216 this.debug(this.pattern, set) 224 217 225 218 // filter out everything that didn't compile properly. … … 228 221 }) 229 222 230 if (options.debug) console.error(this.pattern, set)223 this.debug(this.pattern, set) 231 224 232 225 this.set = set … … 303 296 // and then prepend it to everything we find. 304 297 if (pattern.charAt(0) !== "{") { 305 // console.error(pattern)298 this.debug(pattern) 306 299 var prefix = null 307 300 for (var i = 0, l = pattern.length; i < l; i ++) { 308 301 var c = pattern.charAt(i) 309 // console.error(i, c)302 this.debug(i, c) 310 303 if (c === "\\") { 311 304 escaping = !escaping … … 318 311 // actually no sets, all { were escaped. 319 312 if (prefix === null) { 320 // console.error("no sets")313 this.debug("no sets") 321 314 return [pattern] 322 315 } 323 316 324 var tail = braceExpand(pattern.substr(i), options)317 var tail = braceExpand.call(this, pattern.substr(i), options) 325 318 return tail.map(function (t) { 326 319 return prefix + t … … 337 330 var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) 338 331 if (numset) { 339 // console.error("numset", numset[1], numset[2])340 var suf = braceExpand (pattern.substr(numset[0].length), options)332 this.debug("numset", numset[1], numset[2]) 333 var suf = braceExpand.call(this, pattern.substr(numset[0].length), options) 341 334 , start = +numset[1] 342 335 , end = +numset[2] … … 370 363 } 371 364 372 // console.error("Entering for")365 this.debug("Entering for") 373 366 FOR: for (i = 1, l = pattern.length; i < l; i ++) { 374 367 var c = pattern.charAt(i) 375 // console.error("", i, c)368 this.debug("", i, c) 376 369 377 370 if (escaping) { … … 421 414 // and need to escape the leading brace 422 415 if (depth !== 0) { 423 // console.error("didn't close", pattern)424 return braceExpand ("\\" + pattern, options)416 this.debug("didn't close", pattern) 417 return braceExpand.call(this, "\\" + pattern, options) 425 418 } 426 419 427 420 // x{y,z} -> ["xy", "xz"] 428 // console.error("set", set)429 // console.error("suffix", pattern.substr(i))430 var suf = braceExpand (pattern.substr(i), options)421 this.debug("set", set) 422 this.debug("suffix", pattern.substr(i)) 423 var suf = braceExpand.call(this, pattern.substr(i), options) 431 424 // ["b", "c{d,e}","{f,g}h"] -> 432 425 // [["b"], ["cd", "ce"], ["fh", "gh"]] 433 426 var addBraces = set.length === 1 434 // console.error("set pre-expanded", set)427 this.debug("set pre-expanded", set) 435 428 set = set.map(function (p) { 436 return braceExpand (p, options)437 } )438 // console.error("set expanded", set)429 return braceExpand.call(this, p, options) 430 }, this) 431 this.debug("set expanded", set) 439 432 440 433 … … 497 490 : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" 498 491 : "(?!\\.)" 492 , self = this 499 493 500 494 function clearStateChar () { … … 515 509 break 516 510 } 511 self.debug('clearStateChar %j %j', stateChar, re) 517 512 stateChar = false 518 513 } … … 523 518 ; i ++ ) { 524 519 525 if (options.debug) { 526 console.error("%s\t%s %s %j", pattern, i, re, c) 527 } 520 this.debug("%s\t%s %s %j", pattern, i, re, c) 528 521 529 522 // skip over any that are escaped. … … 552 545 case "@": 553 546 case "!": 554 if (options.debug) { 555 console.error("%s\t%s %s %j <-- stateChar", pattern, i, re, c) 556 } 547 this.debug("%s\t%s %s %j <-- stateChar", pattern, i, re, c) 557 548 558 549 // all of those are literals inside a class, except that 559 550 // the glob [!a] means [^a] in regexp 560 551 if (inClass) { 552 this.debug(' in class') 561 553 if (c === "!" && i === classStart + 1) c = "^" 562 554 re += c … … 567 559 // that there was something like ** or +? in there. 568 560 // Handle the stateChar, then proceed with this one. 561 self.debug('call clearStateChar %j', stateChar) 569 562 clearStateChar() 570 563 stateChar = c … … 592 585 // negation is (?:(?!js)[^/]*) 593 586 re += stateChar === "!" ? "(?:(?!" : "(?:" 587 this.debug('plType %j %j', stateChar, re) 594 588 stateChar = false 595 589 continue … … 601 595 } 602 596 597 clearStateChar() 603 598 hasMagic = true 604 599 re += ")" … … 624 619 } 625 620 621 clearStateChar() 626 622 re += "|" 627 623 continue … … 716 712 }) 717 713 718 // console.error("tail=%j\n %s", tail, tail)714 this.debug("tail=%j\n %s", tail, tail) 719 715 var t = pl.type === "*" ? star 720 716 : pl.type === "?" ? qmark … … 830 826 Minimatch.prototype.match = match 831 827 function match (f, partial) { 832 // console.error("match", f, this.pattern)828 this.debug("match", f, this.pattern) 833 829 // short-circuit in the case of busted things. 834 830 // comments, etc. … … 848 844 // treat the test path as a set of pathparts. 849 845 f = f.split(slashSplit) 850 if (options.debug) { 851 console.error(this.pattern, "split", f) 852 } 846 this.debug(this.pattern, "split", f) 853 847 854 848 // just ONE of the pattern sets in this.set needs to match … … 858 852 859 853 var set = this.set 860 // console.error(this.pattern, "set", set) 854 this.debug(this.pattern, "set", set) 855 856 var splitFile = path.basename(f.join("/")).split("/") 861 857 862 858 for (var i = 0, l = set.length; i < l; i ++) { 863 var pattern = set[i] 864 var hit = this.matchOne(f, pattern, partial) 859 var pattern = set[i], file = f 860 if (options.matchBase && pattern.length === 1) { 861 file = splitFile 862 } 863 var hit = this.matchOne(file, pattern, partial) 865 864 if (hit) { 866 865 if (options.flipNegate) return true … … 883 882 var options = this.options 884 883 885 if (options.debug) { 886 console.error("matchOne", 887 { "this": this 888 , file: file 889 , pattern: pattern }) 890 } 891 892 if (options.matchBase && pattern.length === 1) { 893 file = path.basename(file.join("/")).split("/") 894 } 895 896 if (options.debug) { 897 console.error("matchOne", file.length, pattern.length) 898 } 884 this.debug("matchOne", 885 { "this": this 886 , file: file 887 , pattern: pattern }) 888 889 this.debug("matchOne", file.length, pattern.length) 899 890 900 891 for ( var fi = 0 … … 905 896 ; fi ++, pi ++ ) { 906 897 907 if (options.debug) { 908 console.error("matchOne loop") 909 } 898 this.debug("matchOne loop") 910 899 var p = pattern[pi] 911 900 , f = file[fi] 912 901 913 if (options.debug) { 914 console.error(pattern, p, f) 915 } 902 this.debug(pattern, p, f) 916 903 917 904 // should be impossible. … … 920 907 921 908 if (p === GLOBSTAR) { 922 if (options.debug) 923 console.error('GLOBSTAR', [pattern, p, f]) 909 this.debug('GLOBSTAR', [pattern, p, f]) 924 910 925 911 // "**" … … 948 934 , pr = pi + 1 949 935 if (pr === pl) { 950 if (options.debug) 951 console.error('** at the end') 936 this.debug('** at the end') 952 937 // a ** at the end will just swallow the rest. 953 938 // We have found a match. … … 967 952 var swallowee = file[fr] 968 953 969 if (options.debug) { 970 console.error('\nglobstar while', 971 file, fr, pattern, pr, swallowee) 972 } 954 this.debug('\nglobstar while', 955 file, fr, pattern, pr, swallowee) 973 956 974 957 // XXX remove this slice. Just pass the start index. 975 958 if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { 976 if (options.debug) 977 console.error('globstar found match!', fr, fl, swallowee) 959 this.debug('globstar found match!', fr, fl, swallowee) 978 960 // found a match. 979 961 return true … … 983 965 if (swallowee === "." || swallowee === ".." || 984 966 (!options.dot && swallowee.charAt(0) === ".")) { 985 if (options.debug) 986 console.error("dot detected!", file, fr, pattern, pr) 967 this.debug("dot detected!", file, fr, pattern, pr) 987 968 break WHILE 988 969 } 989 970 990 971 // ** swallows a segment, and continue. 991 if (options.debug) 992 console.error('globstar swallow a segment, and continue') 972 this.debug('globstar swallow a segment, and continue') 993 973 fr ++ 994 974 } … … 999 979 if (partial) { 1000 980 // ran out of file 1001 // console.error("\n>>> no match, partial?", file, fr, pattern, pr)981 this.debug("\n>>> no match, partial?", file, fr, pattern, pr) 1002 982 if (fr === fl) return true 1003 983 } … … 1015 995 hit = f === p 1016 996 } 1017 if (options.debug) { 1018 console.error("string match", p, f, hit) 1019 } 997 this.debug("string match", p, f, hit) 1020 998 } else { 1021 999 hit = f.match(p) 1022 if (options.debug) { 1023 console.error("pattern match", p, f, hit) 1024 } 1000 this.debug("pattern match", p, f, hit) 1025 1001 } 1026 1002 -
Dev/trunk/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/package.json
r484 r516 30 30 "homepage": "https://github.com/isaacs/node-lru-cache", 31 31 "_id": "lru-cache@2.5.0", 32 "dist": { 33 "shasum": "be07d09e5b05f10b83d0cf01d4891a7729288c69" 34 }, 35 "_from": "lru-cache@2", 36 "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz" 32 "_from": "lru-cache@2" 37 33 } -
Dev/trunk/node_modules/grunt/node_modules/minimatch/package.json
r484 r516 7 7 "name": "minimatch", 8 8 "description": "a glob matcher in javascript", 9 "version": "0.2.1 2",9 "version": "0.2.14", 10 10 "repository": { 11 11 "type": "git", … … 14 14 "main": "minimatch.js", 15 15 "scripts": { 16 "test": "tap test "16 "test": "tap test/*.js" 17 17 }, 18 18 "engines": { … … 30 30 "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" 31 31 }, 32 "readme": "# minimatch\n\nA minimal matching utility.\n\n[](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nEventually, it will replace the C binding in node-glob.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\n ```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n### Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not. **Note that this is different from the way that `**` is\nhandled by ruby's `Dir` class.**\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n Each row in the\n array corresponds to a brace-expanded pattern. Each item in the row\n corresponds to a single path-part. For example, the pattern\n `{a,b/c}/d` would expand to a set of patterns like:\n\n [ [ a, d ]\n , [ b, c, d ] ]\n\n If a portion of the pattern doesn't have any \"magic\" in it\n (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n will be left as a string rather than converted to a regular\n expression.\n\n* `regexp` Created by the `makeRe` method. A single regular expression\n expressing the entire pattern. This is useful in cases where you wish\n to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n filename, and match it against a single row in the `regExpSet`. This\n method is mainly for internal use, but is exposed so that it can be\n used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items. So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export. Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`. Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob. If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself. When set, an empty list is returned if there are\nno matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes. For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n",32 "readme": "# minimatch\n\nA minimal matching utility.\n\n[](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nEventually, it will replace the C binding in node-glob.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\nminimatch(\"bar.foo\", \"*.+(bar|foo)\", { debug: true }) // true, and noisy!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n Each row in the\n array corresponds to a brace-expanded pattern. Each item in the row\n corresponds to a single path-part. For example, the pattern\n `{a,b/c}/d` would expand to a set of patterns like:\n\n [ [ a, d ]\n , [ b, c, d ] ]\n\n If a portion of the pattern doesn't have any \"magic\" in it\n (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n will be left as a string rather than converted to a regular\n expression.\n\n* `regexp` Created by the `makeRe` method. A single regular expression\n expressing the entire pattern. This is useful in cases where you wish\n to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n filename, and match it against a single row in the `regExpSet`. This\n method is mainly for internal use, but is exposed so that it can be\n used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items. So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export. Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`. Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob. If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself. When set, an empty list is returned if there are\nno matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes. For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n", 33 33 "readmeFilename": "README.md", 34 34 "bugs": { … … 36 36 }, 37 37 "homepage": "https://github.com/isaacs/minimatch", 38 "_id": "minimatch@0.2.1 2",39 "_from": "minimatch@ 0.x.x"38 "_id": "minimatch@0.2.14", 39 "_from": "minimatch@~0.2.12" 40 40 } -
Dev/trunk/node_modules/grunt/node_modules/rimraf/README.md
r484 r516 1 A`rm -rf` for node.1 `rm -rf` for node. 2 2 3 3 Install with `npm install rimraf`, or just drop rimraf.js somewhere. … … 10 10 errors are handled for you: 11 11 12 * `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times 13 before giving up. 14 * `EMFILE` - If too many file descriptors get opened, rimraf will 15 patiently wait until more become available. 16 12 * Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of 13 `opts.maxBusyTries` times before giving up. 14 * `ENOENT` - If the file doesn't exist, rimraf will return 15 successfully, since your desired outcome is already the case. 17 16 18 17 ## rimraf.sync … … 20 19 It can remove stuff synchronously, too. But that's not so good. Use 21 20 the async API. It's better. 21 22 ## CLI 23 24 If installed with `npm install rimraf -g` it can be used as a global 25 command `rimraf <path>` which is useful for cross platform support. 26 27 ## mkdirp 28 29 If you need to create a directory recursively, check out 30 [mkdirp](https://github.com/substack/node-mkdirp). -
Dev/trunk/node_modules/grunt/node_modules/rimraf/package.json
r484 r516 1 1 { 2 2 "name": "rimraf", 3 "version": "2. 0.3",3 "version": "2.2.6", 4 4 "main": "rimraf.js", 5 5 "description": "A deep deletion module for node (like `rm -rf`)", … … 13 13 "url": "https://github.com/isaacs/rimraf/raw/master/LICENSE" 14 14 }, 15 "optionalDependencies": {16 "graceful-fs": "~1.1"17 },18 15 "repository": { 19 16 "type": "git", … … 22 19 "scripts": { 23 20 "test": "cd test && bash run.sh" 21 }, 22 "bin": { 23 "rimraf": "./bin.js" 24 24 }, 25 25 "contributors": [ … … 46 46 } 47 47 ], 48 "readme": " A `rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\n\nThe callback will be called with an error if there is one. Certain\nerrors are handled for you:\n\n* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too. But that's not so good. Use\nthe async API. It's better.\n",48 "readme": "`rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\n\nThe callback will be called with an error if there is one. Certain\nerrors are handled for you:\n\n* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of\n `opts.maxBusyTries` times before giving up.\n* `ENOENT` - If the file doesn't exist, rimraf will return\n successfully, since your desired outcome is already the case.\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too. But that's not so good. Use\nthe async API. It's better.\n\n## CLI\n\nIf installed with `npm install rimraf -g` it can be used as a global\ncommand `rimraf <path>` which is useful for cross platform support.\n\n## mkdirp\n\nIf you need to create a directory recursively, check out\n[mkdirp](https://github.com/substack/node-mkdirp).\n", 49 49 "readmeFilename": "README.md", 50 50 "bugs": { … … 52 52 }, 53 53 "homepage": "https://github.com/isaacs/rimraf", 54 "dependencies": { 55 "graceful-fs": "~1.1" 54 "_id": "rimraf@2.2.6", 55 "dist": { 56 "shasum": "c28d4de4cafcd392b82d02729509c65e3502240c" 56 57 }, 57 "_ id": "rimraf@2.0.3",58 "_ from": "rimraf@~2.0.3"58 "_from": "rimraf@~2.2.6", 59 "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.6.tgz" 59 60 } -
Dev/trunk/node_modules/grunt/node_modules/rimraf/rimraf.js
r484 r516 3 3 4 4 var path = require("path") 5 , fs 6 7 try { 8 // optional dependency 9 fs = require("graceful-fs") 10 } catch (er) { 11 fs = require("fs") 12 } 13 14 var lstat = "lstat" 15 if (process.platform === "win32") { 16 // not reliable on windows prior to 0.7.9 17 var v = process.version.replace(/^v/, '').split(/\.|-/).map(Number) 18 if (v[0] === 0 && (v[1] < 7 || v[1] == 7 && v[2] < 9)) { 19 lstat = "stat" 20 } 21 } 22 if (!fs[lstat]) lstat = "stat" 23 var lstatSync = lstat + "Sync" 5 var fs = require("fs") 24 6 25 7 // for EMFILE handling … … 28 10 exports.BUSYTRIES_MAX = 3 29 11 12 var isWindows = (process.platform === "win32") 13 30 14 function rimraf (p, cb) { 31 32 15 if (!cb) throw new Error("No callback passed to rimraf()") 33 16 34 17 var busyTries = 0 35 36 18 rimraf_(p, function CB (er) { 37 19 if (er) { 38 if (er.code === "EBUSY" && busyTries < exports.BUSYTRIES_MAX) { 20 if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY") && 21 busyTries < exports.BUSYTRIES_MAX) { 39 22 busyTries ++ 40 23 var time = busyTries * 100 … … 61 44 } 62 45 46 // Two possible strategies. 47 // 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR 48 // 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR 49 // 50 // Both result in an extra syscall when you guess wrong. However, there 51 // are likely far more normal files in the world than directories. This 52 // is based on the assumption that a the average number of files per 53 // directory is >= 1. 54 // 55 // If anyone ever complains about this, then I guess the strategy could 56 // be made configurable somehow. But until then, YAGNI. 63 57 function rimraf_ (p, cb) { 64 fs [lstat](p, function (er, s) {58 fs.unlink(p, function (er) { 65 59 if (er) { 66 // already gone 67 if (er.code === "ENOENT") return cb() 68 // some other kind of error, permissions, etc. 69 return cb(er) 60 if (er.code === "ENOENT") 61 return cb(null) 62 if (er.code === "EPERM") 63 return (isWindows) ? fixWinEPERM(p, er, cb) : rmdir(p, er, cb) 64 if (er.code === "EISDIR") 65 return rmdir(p, er, cb) 70 66 } 71 72 return rm_(p, s, false, cb) 67 return cb(er) 73 68 }) 74 69 } 75 70 76 77 var myGid = function myGid () { 78 var g = process.getgid && process.getgid() 79 myGid = function myGid () { return g } 80 return g 71 function fixWinEPERM (p, er, cb) { 72 fs.chmod(p, 666, function (er2) { 73 if (er2) 74 cb(er2.code === "ENOENT" ? null : er) 75 else 76 fs.stat(p, function(er3, stats) { 77 if (er3) 78 cb(er3.code === "ENOENT" ? null : er) 79 else if (stats.isDirectory()) 80 rmdir(p, er, cb) 81 else 82 fs.unlink(p, cb) 83 }) 84 }) 81 85 } 82 86 83 var myUid = function myUid () { 84 var u = process.getuid && process.getuid() 85 myUid = function myUid () { return u } 86 return u 87 function fixWinEPERMSync (p, er, cb) { 88 try { 89 fs.chmodSync(p, 666) 90 } catch (er2) { 91 if (er2.code !== "ENOENT") 92 throw er 93 } 94 95 try { 96 var stats = fs.statSync(p) 97 } catch (er3) { 98 if (er3 !== "ENOENT") 99 throw er 100 } 101 102 if (stats.isDirectory()) 103 rmdirSync(p, er) 104 else 105 fs.unlinkSync(p) 87 106 } 88 107 89 90 function writable (s) { 91 var mode = s.mode || 0777 92 , uid = myUid() 93 , gid = myGid() 94 return (mode & 0002) 95 || (gid === s.gid && (mode & 0020)) 96 || (uid === s.uid && (mode & 0200)) 108 function rmdir (p, originalEr, cb) { 109 // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) 110 // if we guessed wrong, and it's not a directory, then 111 // raise the original error. 112 fs.rmdir(p, function (er) { 113 if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) 114 rmkids(p, cb) 115 else if (er && er.code === "ENOTDIR") 116 cb(originalEr) 117 else 118 cb(er) 119 }) 97 120 } 98 121 99 function rm_ (p, s, didWritableCheck, cb) { 100 if (!didWritableCheck && !writable(s)) { 101 // make file writable 102 // user/group/world, doesn't matter at this point 103 // since it's about to get nuked. 104 return fs.chmod(p, s.mode | 0222, function (er) { 105 if (er) return cb(er) 106 rm_(p, s, true, cb) 107 }) 108 } 109 110 if (!s.isDirectory()) { 111 return fs.unlink(p, cb) 112 } 113 114 // directory 122 function rmkids(p, cb) { 115 123 fs.readdir(p, function (er, files) { 116 if (er) return cb(er) 117 asyncForEach(files.map(function (f) { 118 return path.join(p, f) 119 }), function (file, cb) { 120 rimraf(file, cb) 121 }, function (er) { 122 if (er) return cb(er) 123 fs.rmdir(p, cb) 124 if (er) 125 return cb(er) 126 var n = files.length 127 if (n === 0) 128 return fs.rmdir(p, cb) 129 var errState 130 files.forEach(function (f) { 131 rimraf(path.join(p, f), function (er) { 132 if (errState) 133 return 134 if (er) 135 return cb(errState = er) 136 if (--n === 0) 137 fs.rmdir(p, cb) 138 }) 124 139 }) 125 140 }) 126 141 } 127 142 128 function asyncForEach (list, fn, cb) { 129 if (!list.length) cb() 130 var c = list.length 131 , errState = null 132 list.forEach(function (item, i, list) { 133 fn(item, function (er) { 134 if (errState) return 135 if (er) return cb(errState = er) 136 if (-- c === 0) return cb() 137 }) 138 }) 143 // this looks simpler, and is strictly *faster*, but will 144 // tie up the JavaScript thread and fail on excessively 145 // deep directory trees. 146 function rimrafSync (p) { 147 try { 148 fs.unlinkSync(p) 149 } catch (er) { 150 if (er.code === "ENOENT") 151 return 152 if (er.code === "EPERM") 153 return isWindows ? fixWinEPERMSync(p, er) : rmdirSync(p, er) 154 if (er.code !== "EISDIR") 155 throw er 156 rmdirSync(p, er) 157 } 139 158 } 140 159 141 // this looks simpler, but it will fail with big directory trees, 142 // or on slow stupid awful cygwin filesystems 143 function rimrafSync (p) { 160 function rmdirSync (p, originalEr) { 144 161 try { 145 var s = fs[lstatSync](p)162 fs.rmdirSync(p) 146 163 } catch (er) { 147 if (er.code === "ENOENT") return 148 throw er 164 if (er.code === "ENOENT") 165 return 166 if (er.code === "ENOTDIR") 167 throw originalEr 168 if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") 169 rmkidsSync(p) 149 170 } 171 } 150 172 151 if (!writable(s)) { 152 fs.chmodSync(p, s.mode | 0222) 153 } 154 155 if (!s.isDirectory()) return fs.unlinkSync(p) 156 173 function rmkidsSync (p) { 157 174 fs.readdirSync(p).forEach(function (f) { 158 175 rimrafSync(path.join(p, f)) -
Dev/trunk/node_modules/grunt/node_modules/underscore.string/package.json
r484 r516 69 69 "readmeFilename": "README.markdown", 70 70 "_id": "underscore.string@2.2.1", 71 "dist": { 72 "shasum": "2aa155e7c49bcbfd88ec69b8c9694d885385c717" 73 }, 74 "_from": "underscore.string@~2.2.1", 75 "_resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.2.1.tgz" 71 "_from": "underscore.string@~2.2.1" 76 72 } -
Dev/trunk/node_modules/grunt/package.json
r484 r516 2 2 "name": "grunt", 3 3 "description": "The JavaScript Task Runner", 4 "version": "0.4. 2",4 "version": "0.4.4", 5 5 "author": { 6 6 "name": "\"Cowboy\" Ben Alman", … … 59 59 "minimatch": "~0.2.12", 60 60 "nopt": "~1.0.10", 61 "rimraf": "~2. 0.3",61 "rimraf": "~2.2.6", 62 62 "lodash": "~0.9.2", 63 63 "underscore.string": "~2.2.1", … … 65 65 "js-yaml": "~2.0.5", 66 66 "exit": "~0.1.1", 67 "getobject": "~0.1.0" 67 "getobject": "~0.1.0", 68 "grunt-legacy-util": "~0.1.2" 68 69 }, 69 70 "devDependencies": { … … 76 77 "shelljs": "~0.2.5" 77 78 }, 78 "readme": "# Grunt: The JavaScript Task Runner [](http://travis-ci.org/gruntjs/grunt)\n\n<img align=\"right\" height=\"260\" src=\"http://gruntjs.com/img/grunt-logo-no-wordmark.svg\">\n\n\n### Documentation\n\nVisit the [gruntjs.com](http://gruntjs.com/) website for all the things.\n\n### Support / Contributing\nBefore you make an issue, please read our [Contributing](http://gruntjs.com/contributing) guide.\n\nYou can find the grunt team in [#grunt on irc.freenode.net](http://webchat.freenode.net/?channels=grunt).\n\n### Release History\nSee the [CHANGELOG](CHANGELOG).\n",79 "readme": "# Grunt: The JavaScript Task Runner\n\n[](http://travis-ci.org/gruntjs/grunt)\n[](http://gruntjs.com/)\n\n<img align=\"right\" height=\"260\" src=\"http://gruntjs.com/img/grunt-logo-no-wordmark.svg\">\n\n\n### Documentation\n\nVisit the [gruntjs.com](http://gruntjs.com/) website for all the things.\n\n### Support / Contributing\nBefore you make an issue, please read our [Contributing](http://gruntjs.com/contributing) guide.\n\nYou can find the grunt team in [#grunt on irc.freenode.net](http://webchat.freenode.net/?channels=grunt).\n\n### Release History\nSee the [CHANGELOG](CHANGELOG).\n", 79 80 "readmeFilename": "README.md", 80 "_id": "grunt@0.4. 2",81 "_id": "grunt@0.4.4", 81 82 "dist": { 82 "shasum": " 1f6804f00e977dd90b9f97b1faed480215db0857"83 "shasum": "64f477fef801475ab92f1819a691c6c71b72902e" 83 84 }, 84 "_from": "grunt@0.4. 2",85 "_resolved": "https://registry.npmjs.org/grunt/-/grunt-0.4. 2.tgz"85 "_from": "grunt@0.4.4", 86 "_resolved": "https://registry.npmjs.org/grunt/-/grunt-0.4.4.tgz" 86 87 }
Note: See TracChangeset
for help on using the changeset viewer.