pax_global_header00006660000000000000000000000064123655404310014515gustar00rootroot0000000000000052 comment=a7d85acf4e89fa26d17396ab022ef98fbe1f8a4b node-glob-4.0.5/000077500000000000000000000000001236554043100133715ustar00rootroot00000000000000node-glob-4.0.5/.gitignore000066400000000000000000000000361236554043100153600ustar00rootroot00000000000000.*.swp test/a/ node_modules/* node-glob-4.0.5/.travis.yml000066400000000000000000000000551236554043100155020ustar00rootroot00000000000000language: node_js node_js: - 0.10 - 0.11 node-glob-4.0.5/LICENSE000066400000000000000000000013751236554043100144040ustar00rootroot00000000000000The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. node-glob-4.0.5/README.md000066400000000000000000000227661236554043100146650ustar00rootroot00000000000000# Glob Match files using the patterns the shell uses, like stars and stuff. This is a glob implementation in JavaScript. It uses the `minimatch` library to do its matching. ## Attention: node-glob users! The API has changed dramatically between 2.x and 3.x. This library is now 100% JavaScript, and the integer flags have been replaced with an options object. Also, there's an event emitter class, proper tests, and all the other things you've come to expect from node modules. And best of all, no compilation! ## Usage ```javascript var glob = require("glob") // options is optional glob("**/*.js", options, function (er, files) { // files is an array of filenames. // If the `nonull` option is set, and nothing // was found, then files is ["**/*.js"] // er is an error object or null. }) ``` ## Features Please see the [minimatch documentation](https://github.com/isaacs/minimatch) for more details. Supports these glob features: * Brace Expansion * Extended glob matching * "Globstar" `**` matching See: * `man sh` * `man bash` * `man 3 fnmatch` * `man 5 gitignore` * [minimatch documentation](https://github.com/isaacs/minimatch) ## glob(pattern, [options], cb) * `pattern` {String} Pattern to be matched * `options` {Object} * `cb` {Function} * `err` {Error | null} * `matches` {Array} filenames found matching the pattern Perform an asynchronous glob search. ## glob.sync(pattern, [options]) * `pattern` {String} Pattern to be matched * `options` {Object} * return: {Array} filenames found matching the pattern Perform a synchronous glob search. ## Class: glob.Glob Create a Glob object by instanting the `glob.Glob` class. ```javascript var Glob = require("glob").Glob var mg = new Glob(pattern, options, cb) ``` It's an EventEmitter, and starts walking the filesystem to find matches immediately. ### new glob.Glob(pattern, [options], [cb]) * `pattern` {String} pattern to search for * `options` {Object} * `cb` {Function} Called when an error occurs, or matches are found * `err` {Error | null} * `matches` {Array} filenames found matching the pattern Note that if the `sync` flag is set in the options, then matches will be immediately available on the `g.found` member. ### Properties * `minimatch` The minimatch object that the glob uses. * `options` The options object passed in. * `error` The error encountered. When an error is encountered, the glob object is in an undefined state, and should be discarded. * `aborted` Boolean which is set to true when calling `abort()`. There is no way at this time to continue a glob search after aborting, but you can re-use the statCache to avoid having to duplicate syscalls. * `statCache` Collection of all the stat results the glob search performed. * `cache` Convenience object. Each field has the following possible values: * `false` - Path does not exist * `true` - Path exists * `1` - Path exists, and is not a directory * `2` - Path exists, and is a directory * `[file, entries, ...]` - Path exists, is a directory, and the array value is the results of `fs.readdir` ### Events * `end` When the matching is finished, this is emitted with all the matches found. If the `nonull` option is set, and no match was found, then the `matches` list contains the original pattern. The matches are sorted, unless the `nosort` flag is set. * `match` Every time a match is found, this is emitted with the matched. * `error` Emitted when an unexpected error is encountered, or whenever any fs error occurs if `options.strict` is set. * `abort` When `abort()` is called, this event is raised. ### Methods * `abort` Stop the search. ### Options All the options that can be passed to Minimatch can also be passed to Glob to change pattern matching behavior. Also, some have been added, or have glob-specific ramifications. All options are false by default, unless otherwise noted. All options are added to the glob object, as well. * `cwd` The current working directory in which to search. Defaults to `process.cwd()`. * `root` The place where patterns starting with `/` will be mounted onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix systems, and `C:\` or some such on Windows.) * `dot` Include `.dot` files in normal matches and `globstar` matches. Note that an explicit dot in a portion of the pattern will always match dot files. * `nomount` By default, a pattern starting with a forward-slash will be "mounted" onto the root setting, so that a valid filesystem path is returned. Set this flag to disable that behavior. * `mark` Add a `/` character to directory matches. Note that this requires additional stat calls. * `nosort` Don't sort the results. * `stat` Set to true to stat *all* results. This reduces performance somewhat, and is completely unnecessary, unless `readdir` is presumed to be an untrustworthy indicator of file existence. It will cause ELOOP to be triggered one level sooner in the case of cyclical symbolic links. * `silent` When an unusual error is encountered when attempting to read a directory, a warning will be printed to stderr. Set the `silent` option to true to suppress these warnings. * `strict` When an unusual error is encountered when attempting to read a directory, the process will just continue on in search of other matches. Set the `strict` option to raise an error in these cases. * `cache` See `cache` property above. Pass in a previously generated cache object to save some fs calls. * `statCache` A cache of results of filesystem information, to prevent unnecessary stat calls. While it should not normally be necessary to set this, you may pass the statCache from one glob() call to the options object of another, if you know that the filesystem will not change between calls. (See "Race Conditions" below.) * `sync` Perform a synchronous glob search. * `nounique` In some cases, brace-expanded patterns can result in the same file showing up multiple times in the result set. By default, this implementation prevents duplicates in the result set. Set this flag to disable that behavior. * `nonull` Set to never return an empty set, instead returning a set containing the pattern itself. This is the default in glob(3). * `nocase` Perform a case-insensitive match. Note that case-insensitive filesystems will sometimes result in glob returning results that are case-insensitively matched anyway, since readdir and stat will not raise an error. * `debug` Set to enable debug logging in minimatch and glob. * `globDebug` Set to enable debug logging in glob, but not minimatch. ## Comparisons to other fnmatch/glob implementations While strict compliance with the existing standards is a worthwhile goal, some discrepancies exist between node-glob and other implementations, and are intentional. If the pattern starts with a `!` character, then it is negated. Set the `nonegate` flag to suppress this behavior, and treat leading `!` characters normally. This is perhaps relevant if you wish to start the pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` characters at the start of a pattern will negate the pattern multiple times. If a pattern starts with `#`, then it is treated as a comment, and will not match anything. Use `\#` to match a literal `#` at the start of a line, or set the `nocomment` flag to suppress this behavior. The double-star character `**` is supported by default, unless the `noglobstar` flag is set. This is supported in the manner of bsdglob and bash 4.1, where `**` only has special significance if it is the only thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but `a/**b` will not. If an escaped pattern has no matches, and the `nonull` flag is set, then glob returns the pattern as-provided, rather than interpreting the character escapes. For example, `glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than `"*a?"`. This is akin to setting the `nullglob` option in bash, except that it does not resolve escaped pattern characters. If brace expansion is not disabled, then it is performed before any other interpretation of the glob pattern. Thus, a pattern like `+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded **first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are checked for validity. Since those two are valid, matching proceeds. ## Windows **Please only use forward-slashes in glob expressions.** Though windows uses either `/` or `\` as its path separator, only `/` characters are used by this glob implementation. You must use forward-slashes **only** in glob expressions. Back-slashes will always be interpreted as escape characters, not path separators. Results from absolute patterns such as `/foo/*` are mounted onto the root setting using `path.join`. On windows, this will by default result in `/foo/*` matching `C:\foo\bar.txt`. ## Race Conditions Glob searching, by its very nature, is susceptible to race conditions, since it relies on directory walking and such. As a result, it is possible that a file that exists when glob looks for it may have been deleted or modified by the time it returns the result. As part of its internal implementation, this program caches all stat and readdir calls that it makes, in order to cut down on system overhead. However, this also makes it even more susceptible to races, especially if the cache or statCache objects are reused between glob calls. Users are thus advised not to use a glob result as a guarantee of filesystem state in the face of rapid changes. For the vast majority of operations, this is never a problem. node-glob-4.0.5/examples/000077500000000000000000000000001236554043100152075ustar00rootroot00000000000000node-glob-4.0.5/examples/g.js000066400000000000000000000003441236554043100157740ustar00rootroot00000000000000var Glob = require("../").Glob var pattern = "test/a/**/[cg]/../[cg]" console.log(pattern) var mg = new Glob(pattern, {mark: true, sync:true}, function (er, matches) { console.log("matches", matches) }) console.log("after") node-glob-4.0.5/examples/usr-local.js000066400000000000000000000003321236554043100174440ustar00rootroot00000000000000var Glob = require("../").Glob var pattern = "{./*/*,/*,/usr/local/*}" console.log(pattern) var mg = new Glob(pattern, {mark: true}, function (er, matches) { console.log("matches", matches) }) console.log("after") node-glob-4.0.5/glob.js000066400000000000000000000467311236554043100146650ustar00rootroot00000000000000// Approach: // // 1. Get the minimatch set // 2. For each pattern in the set, PROCESS(pattern) // 3. Store matches per-set, then uniq them // // PROCESS(pattern) // Get the first [n] items from pattern that are all strings // Join these together. This is PREFIX. // If there is no more remaining, then stat(PREFIX) and // add to matches if it succeeds. END. // readdir(PREFIX) as ENTRIES // If fails, END // If pattern[n] is GLOBSTAR // // handle the case where the globstar match is empty // // by pruning it out, and testing the resulting pattern // PROCESS(pattern[0..n] + pattern[n+1 .. $]) // // handle other cases. // for ENTRY in ENTRIES (not dotfiles) // // attach globstar + tail onto the entry // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $]) // // else // not globstar // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) // Test ENTRY against pattern[n] // If fails, continue // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) // // Caveat: // Cache all stats and readdirs results to minimize syscall. Since all // we ever care about is existence and directory-ness, we can just keep // `true` for files, and [children,...] for directories, or `false` for // things that don't exist. module.exports = glob var fs try { fs = require("graceful-fs") } catch (e) { fs = require("fs") } var minimatch = require("minimatch") , Minimatch = minimatch.Minimatch , inherits = require("inherits") , EE = require("events").EventEmitter , path = require("path") , isDir = {} , assert = require("assert").ok , once = require("once") function glob (pattern, options, cb) { if (typeof options === "function") cb = options, options = {} if (!options) options = {} if (typeof options === "number") { deprecated() return } var g = new Glob(pattern, options, cb) return g.sync ? g.found : g } glob.fnmatch = deprecated function deprecated () { throw new Error("glob's interface has changed. Please see the docs.") } glob.sync = globSync function globSync (pattern, options) { if (typeof options === "number") { deprecated() return } options = options || {} options.sync = true return glob(pattern, options) } this._processingEmitQueue = false glob.Glob = Glob inherits(Glob, EE) function Glob (pattern, options, cb) { if (!(this instanceof Glob)) { return new Glob(pattern, options, cb) } if (typeof options === "function") { cb = options options = null } if (typeof cb === "function") { cb = once(cb) this.on("error", cb) this.on("end", function (matches) { cb(null, matches) }) } options = options || {} this._endEmitted = false this.EOF = {} this._emitQueue = [] this.paused = false this._processingEmitQueue = false this.maxDepth = options.maxDepth || 1000 this.maxLength = options.maxLength || Infinity this.cache = options.cache || {} this.statCache = options.statCache || {} this.changedCwd = false var cwd = process.cwd() if (!options.hasOwnProperty("cwd")) this.cwd = cwd else { this.cwd = options.cwd this.changedCwd = path.resolve(options.cwd) !== cwd } this.root = options.root || path.resolve(this.cwd, "/") this.root = path.resolve(this.root) if (process.platform === "win32") this.root = this.root.replace(/\\/g, "/") this.nomount = !!options.nomount if (!pattern) { throw new Error("must provide pattern") } // base-matching: just use globstar for that. if (options.matchBase && -1 === pattern.indexOf("/")) { if (options.noglobstar) { throw new Error("base matching requires globstar") } pattern = "**/" + pattern } this.strict = options.strict !== false this.dot = !!options.dot this.mark = !!options.mark this.sync = !!options.sync this.nounique = !!options.nounique this.nonull = !!options.nonull this.nosort = !!options.nosort this.nocase = !!options.nocase this.stat = !!options.stat this.debug = !!options.debug || !!options.globDebug if (/\bglob\b/.test(process.env.NODE_DEBUG || '')) this.debug = true if (this.debug) this.log = console.error this.silent = !!options.silent var mm = this.minimatch = new Minimatch(pattern, options) this.options = mm.options pattern = this.pattern = mm.pattern this.error = null this.aborted = false // list of all the patterns that ** has resolved do, so // we can avoid visiting multiple times. this._globstars = {} EE.call(this) // process each pattern in the minimatch set var n = this.minimatch.set.length // The matches are stored as {: true,...} so that // duplicates are automagically pruned. // Later, we do an Object.keys() on these. // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) if (this.minimatch.set.length === 0) { return process.nextTick(this._finish.bind(this)) } this.minimatch.set.forEach(iterator.bind(this)) function iterator (pattern, i, set) { this._process(pattern, 0, i, function (er) { if (er) this.emit("error", er) if (-- n <= 0) this._finish() }) } } Glob.prototype.log = function () {} Glob.prototype._finish = function () { assert(this instanceof Glob) var nou = this.nounique , all = nou ? [] : {} for (var i = 0, l = this.matches.length; i < l; i ++) { var matches = this.matches[i] this.log("matches[%d] =", i, matches) // do like the shell, and spit out the literal glob if (!matches) { if (this.nonull) { var literal = this.minimatch.globSet[i] if (nou) all.push(literal) else all[literal] = true } } else { // had matches var m = Object.keys(matches) if (nou) all.push.apply(all, m) else m.forEach(function (m) { all[m] = true }) } } if (!nou) all = Object.keys(all) if (!this.nosort) { all = all.sort(this.nocase ? alphasorti : alphasort) } if (this.mark) { // at *some* point we statted all of these all = all.map(this._mark, this) } this.log("emitting end", all) this.EOF = this.found = all this.emitMatch(this.EOF) } function alphasorti (a, b) { a = a.toLowerCase() b = b.toLowerCase() return alphasort(a, b) } function alphasort (a, b) { return a > b ? 1 : a < b ? -1 : 0 } Glob.prototype._mark = function (p) { var c = this.cache[p] var m = p if (c) { var isDir = c === 2 || Array.isArray(c) var slash = p.slice(-1) === '/' if (isDir && !slash) m += '/' else if (!isDir && slash) m = m.slice(0, -1) if (m !== p) { this.statCache[m] = this.statCache[p] this.cache[m] = this.cache[p] } } return m } Glob.prototype.abort = function () { this.aborted = true this.emit("abort") } Glob.prototype.pause = function () { if (this.paused) return if (this.sync) this.emit("error", new Error("Can't pause/resume sync glob")) this.paused = true this.emit("pause") } Glob.prototype.resume = function () { if (!this.paused) return if (this.sync) this.emit("error", new Error("Can't pause/resume sync glob")) this.paused = false this.emit("resume") this._processEmitQueue() //process.nextTick(this.emit.bind(this, "resume")) } Glob.prototype.emitMatch = function (m) { this.log('emitMatch', m) this._emitQueue.push(m) this._processEmitQueue() } Glob.prototype._processEmitQueue = function (m) { this.log("pEQ paused=%j processing=%j m=%j", this.paused, this._processingEmitQueue, m) var done = false while (!this._processingEmitQueue && !this.paused) { this._processingEmitQueue = true var m = this._emitQueue.shift() this.log(">processEmitQueue", m === this.EOF ? ":EOF:" : m) if (!m) { this.log(">processEmitQueue, falsey m") this._processingEmitQueue = false break } if (m === this.EOF || !(this.mark && !this.stat)) { this.log("peq: unmarked, or eof") next.call(this, 0, false) } else if (this.statCache[m]) { var sc = this.statCache[m] var exists if (sc) exists = sc.isDirectory() ? 2 : 1 this.log("peq: stat cached") next.call(this, exists, exists === 2) } else { this.log("peq: _stat, then next") this._stat(m, next) } } done = true function next(exists, isDir) { this.log("next", m, exists, isDir) var ev = m === this.EOF ? "end" : "match" // "end" can only happen once. assert(!this._endEmitted) if (ev === "end") this._endEmitted = true if (exists) { // Doesn't mean it necessarily doesn't exist, it's possible // we just didn't check because we don't care that much, or // this is EOF anyway. if (isDir && !m.match(/\/$/)) { m = m + "/" } else if (!isDir && m.match(/\/$/)) { m = m.replace(/\/+$/, "") } } this.log("emit", ev, m) this.emit(ev, m) this._processingEmitQueue = false if (done && m !== this.EOF && !this.paused) this._processEmitQueue() } } Glob.prototype._process = function (pattern, depth, index, cb_) { assert(this instanceof Glob) var cb = function cb (er, res) { assert(this instanceof Glob) if (this.paused) { if (!this._processQueue) { this._processQueue = [] this.once("resume", function () { var q = this._processQueue this._processQueue = null q.forEach(function (cb) { cb() }) }) } this._processQueue.push(cb_.bind(this, er, res)) } else { cb_.call(this, er, res) } }.bind(this) if (this.aborted) return cb() if (depth > this.maxDepth) return cb() // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === "string") { n ++ } // now n is the index of the first one that is *not* a string. // see if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: prefix = pattern.join("/") this._stat(prefix, function (exists, isDir) { // either it's there, or it isn't. // nothing more to do, either way. if (exists) { if (prefix && isAbsolute(prefix) && !this.nomount) { if (prefix.charAt(0) === "/") { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) } } if (process.platform === "win32") prefix = prefix.replace(/\\/g, "/") this.matches[index] = this.matches[index] || {} this.matches[index][prefix] = true this.emitMatch(prefix) } return cb() }) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's "absolute" like /foo/bar, // or "relative" like "../baz" prefix = pattern.slice(0, n) prefix = prefix.join("/") break } // get the list of entries. var read if (prefix === null) read = "." else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { if (!prefix || !isAbsolute(prefix)) { prefix = "/" + prefix } read = prefix // if (process.platform === "win32") // read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/") this.log('absolute: ', prefix, this.root, pattern, read) } else { read = prefix } this.log('readdir(%j)', read, this.cwd, this.root) return this._readdir(read, function (er, entries) { if (er) { // not a directory! // this means that, whatever else comes after this, it can never match return cb() } // globstar is special if (pattern[n] === minimatch.GLOBSTAR) { // test without the globstar, and with every child both below // and replacing the globstar. var s = [ pattern.slice(0, n).concat(pattern.slice(n + 1)) ] entries.forEach(function (e) { if (e.charAt(0) === "." && !this.dot) return // instead of the globstar s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1))) // below the globstar s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n))) }, this) s = s.filter(function (pattern) { var key = gsKey(pattern) var seen = !this._globstars[key] this._globstars[key] = true return seen }, this) if (!s.length) return cb() // now asyncForEach over this var l = s.length , errState = null s.forEach(function (gsPattern) { this._process(gsPattern, depth + 1, index, function (er) { if (errState) return if (er) return cb(errState = er) if (--l <= 0) return cb() }) }, this) return } // not a globstar // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = pattern[n] var negate = !!this.minimatch.negate; var rawGlob = pattern[n]._glob , dotOk = this.dot || rawGlob.charAt(0) === "." entries = entries.filter(function (e) { if (e.charAt(0) !== "." || dotOk) { if (negate && n === 0) { return !e.match(pattern[n]); } else { return e.match(pattern[n]); } } return null; }) // If n === pattern.length - 1, then there's no need for the extra stat // *unless* the user has specified "mark" or "stat" explicitly. // We know that they exist, since the readdir returned them. if (n === pattern.length - 1 && !this.mark && !this.stat) { entries.forEach(function (e) { if (prefix) { if (prefix !== "/") e = prefix + "/" + e else e = prefix + e } if (e.charAt(0) === "/" && !this.nomount) { e = path.join(this.root, e) } if (process.platform === "win32") e = e.replace(/\\/g, "/") this.matches[index] = this.matches[index] || {} this.matches[index][e] = true this.emitMatch(e) }, this) return cb.call(this) } // now test all the remaining entries as stand-ins for that part // of the pattern. var l = entries.length , errState = null if (l === 0) return cb() // no matches possible entries.forEach(function (e) { var p = pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1)) this._process(p, depth + 1, index, function (er) { if (errState) return if (er) return cb(errState = er) if (--l === 0) return cb.call(this) }) }, this) }) } function gsKey (pattern) { return '**' + pattern.map(function (p) { return (p === minimatch.GLOBSTAR) ? '**' : (''+p) }).join('/') } Glob.prototype._stat = function (f, cb) { assert(this instanceof Glob) var abs = f if (f.charAt(0) === "/") { abs = path.join(this.root, f) } else if (this.changedCwd) { abs = path.resolve(this.cwd, f) } if (f.length > this.maxLength) { var er = new Error("Path name too long") er.code = "ENAMETOOLONG" er.path = f return this._afterStat(f, abs, cb, er) } this.log('stat', [this.cwd, f, '=', abs]) if (!this.stat && this.cache.hasOwnProperty(f)) { var exists = this.cache[f] , isDir = exists && (Array.isArray(exists) || exists === 2) if (this.sync) return cb.call(this, !!exists, isDir) return process.nextTick(cb.bind(this, !!exists, isDir)) } var stat = this.statCache[abs] if (this.sync || stat) { var er try { stat = fs.statSync(abs) } catch (e) { er = e } this._afterStat(f, abs, cb, er, stat) } else { fs.stat(abs, this._afterStat.bind(this, f, abs, cb)) } } Glob.prototype._afterStat = function (f, abs, cb, er, stat) { var exists assert(this instanceof Glob) if (abs.slice(-1) === "/" && stat && !stat.isDirectory()) { this.log("should be ENOTDIR, fake it") er = new Error("ENOTDIR, not a directory '" + abs + "'") er.path = abs er.code = "ENOTDIR" stat = null } var emit = !this.statCache[abs] this.statCache[abs] = stat if (er || !stat) { exists = false } else { exists = stat.isDirectory() ? 2 : 1 if (emit) this.emit('stat', f, stat) } this.cache[f] = this.cache[f] || exists cb.call(this, !!exists, exists === 2) } Glob.prototype._readdir = function (f, cb) { assert(this instanceof Glob) var abs = f if (f.charAt(0) === "/") { abs = path.join(this.root, f) } else if (isAbsolute(f)) { abs = f } else if (this.changedCwd) { abs = path.resolve(this.cwd, f) } if (f.length > this.maxLength) { var er = new Error("Path name too long") er.code = "ENAMETOOLONG" er.path = f return this._afterReaddir(f, abs, cb, er) } this.log('readdir', [this.cwd, f, abs]) if (this.cache.hasOwnProperty(f)) { var c = this.cache[f] if (Array.isArray(c)) { if (this.sync) return cb.call(this, null, c) return process.nextTick(cb.bind(this, null, c)) } if (!c || c === 1) { // either ENOENT or ENOTDIR var code = c ? "ENOTDIR" : "ENOENT" , er = new Error((c ? "Not a directory" : "Not found") + ": " + f) er.path = f er.code = code this.log(f, er) if (this.sync) return cb.call(this, er) return process.nextTick(cb.bind(this, er)) } // at this point, c === 2, meaning it's a dir, but we haven't // had to read it yet, or c === true, meaning it's *something* // but we don't have any idea what. Need to read it, either way. } if (this.sync) { var er, entries try { entries = fs.readdirSync(abs) } catch (e) { er = e } return this._afterReaddir(f, abs, cb, er, entries) } fs.readdir(abs, this._afterReaddir.bind(this, f, abs, cb)) } Glob.prototype._afterReaddir = function (f, abs, cb, er, entries) { assert(this instanceof Glob) if (entries && !er) { this.cache[f] = entries // if we haven't asked to stat everything for suresies, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. This also gets us one step // further into ELOOP territory. if (!this.mark && !this.stat) { entries.forEach(function (e) { if (f === "/") e = f + e else e = f + "/" + e this.cache[e] = true }, this) } return cb.call(this, er, entries) } // now handle errors, and cache the information if (er) switch (er.code) { case "ENOTDIR": // totally normal. means it *does* exist. this.cache[f] = 1 return cb.call(this, er) case "ENOENT": // not terribly unusual case "ELOOP": case "ENAMETOOLONG": case "UNKNOWN": this.cache[f] = false return cb.call(this, er) default: // some unusual error. Treat as failure. this.cache[f] = false if (this.strict) this.emit("error", er) if (!this.silent) console.error("glob error", er) return cb.call(this, er) } } var isAbsolute = process.platform === "win32" ? absWin : absUnix function absWin (p) { if (absUnix(p)) return true // pull off the device/UNC bit from a windows path. // from node's lib/path.js var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ , result = splitDeviceRe.exec(p) , device = result[1] || '' , isUnc = device && device.charAt(1) !== ':' , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute return isAbsolute } function absUnix (p) { return p.charAt(0) === "/" || p === "" } node-glob-4.0.5/package.json000066400000000000000000000012261236554043100156600ustar00rootroot00000000000000{ "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "glob", "description": "a little globber", "version": "4.0.5", "repository": { "type": "git", "url": "git://github.com/isaacs/node-glob.git" }, "main": "glob.js", "engines": { "node": "*" }, "optionalDependencies": { "graceful-fs": "^3.0.2" }, "dependencies": { "inherits": "2", "minimatch": "^1.0.0", "once": "^1.3.0" }, "devDependencies": { "tap": "~0.4.0", "mkdirp": "0", "rimraf": "1" }, "scripts": { "test": "tap test/*.js", "test-regen": "TEST_REGEN=1 node test/00-setup.js" }, "license": "ISC" } node-glob-4.0.5/test/000077500000000000000000000000001236554043100143505ustar00rootroot00000000000000node-glob-4.0.5/test/00-setup.js000066400000000000000000000103121236554043100162600ustar00rootroot00000000000000// just a little pre-run script to set up the fixtures. // zz-finish cleans it up var mkdirp = require("mkdirp") var path = require("path") var i = 0 var tap = require("tap") var fs = require("fs") var rimraf = require("rimraf") var files = [ "a/.abcdef/x/y/z/a" , "a/abcdef/g/h" , "a/abcfed/g/h" , "a/b/c/d" , "a/bc/e/f" , "a/c/d/c/b" , "a/cb/e/f" ] var symlinkTo = path.resolve(__dirname, "a/symlink/a/b/c") var symlinkFrom = "../.." files = files.map(function (f) { return path.resolve(__dirname, f) }) tap.test("remove fixtures", function (t) { rimraf(path.resolve(__dirname, "a"), function (er) { t.ifError(er, "remove fixtures") t.end() }) }) files.forEach(function (f) { tap.test(f, function (t) { var d = path.dirname(f) mkdirp(d, 0755, function (er) { if (er) { t.fail(er) return t.bailout() } fs.writeFile(f, "i like tests", function (er) { t.ifError(er, "make file") t.end() }) }) }) }) if (process.platform !== "win32") { tap.test("symlinky", function (t) { var d = path.dirname(symlinkTo) console.error("mkdirp", d) mkdirp(d, 0755, function (er) { t.ifError(er) fs.symlink(symlinkFrom, symlinkTo, "dir", function (er) { t.ifError(er, "make symlink") t.end() }) }) }) } ;["foo","bar","baz","asdf","quux","qwer","rewq"].forEach(function (w) { w = "/tmp/glob-test/" + w tap.test("create " + w, function (t) { mkdirp(w, function (er) { if (er) throw er t.pass(w) t.end() }) }) }) // generate the bash pattern test-fixtures if possible if (process.platform === "win32" || !process.env.TEST_REGEN) { console.error("Windows, or TEST_REGEN unset. Using cached fixtures.") return } var spawn = require("child_process").spawn; var globs = // put more patterns here. // anything that would be directly in / should be in /tmp/glob-test ["test/a/*/+(c|g)/./d" ,"test/a/**/[cg]/../[cg]" ,"test/a/{b,c,d,e,f}/**/g" ,"test/a/b/**" ,"test/**/g" ,"test/a/abc{fed,def}/g/h" ,"test/a/abc{fed/g,def}/**/" ,"test/a/abc{fed/g,def}/**///**/" ,"test/**/a/**/" ,"test/+(a|b|c)/a{/,bc*}/**" ,"test/*/*/*/f" ,"test/**/f" ,"test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**" ,"{./*/*,/tmp/glob-test/*}" ,"{/tmp/glob-test/*,*}" // evil owl face! how you taunt me! ,"test/a/!(symlink)/**" ] var bashOutput = {} var fs = require("fs") globs.forEach(function (pattern) { tap.test("generate fixture " + pattern, function (t) { var cmd = "shopt -s globstar && " + "shopt -s extglob && " + "shopt -s nullglob && " + // "shopt >&2; " + "eval \'for i in " + pattern + "; do echo $i; done\'" var cp = spawn("bash", ["-c", cmd], { cwd: path.dirname(__dirname) }) var out = [] cp.stdout.on("data", function (c) { out.push(c) }) cp.stderr.pipe(process.stderr) cp.on("close", function (code) { out = flatten(out) if (!out) out = [] else out = cleanResults(out.split(/\r*\n/)) bashOutput[pattern] = out t.notOk(code, "bash test should finish nicely") t.end() }) }) }) tap.test("save fixtures", function (t) { var fname = path.resolve(__dirname, "bash-results.json") var data = JSON.stringify(bashOutput, null, 2) + "\n" fs.writeFile(fname, data, function (er) { t.ifError(er) t.end() }) }) function cleanResults (m) { // normalize discrepancies in ordering, duplication, // and ending slashes. return m.map(function (m) { return m.replace(/\/+/g, "/").replace(/\/$/, "") }).sort(alphasort).reduce(function (set, f) { if (f !== set[set.length - 1]) set.push(f) return set }, []).sort(alphasort).map(function (f) { // de-windows return (process.platform !== 'win32') ? f : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') }) } function flatten (chunks) { var s = 0 chunks.forEach(function (c) { s += c.length }) var out = new Buffer(s) s = 0 chunks.forEach(function (c) { c.copy(out, s) s += c.length }) return out.toString().trim() } function alphasort (a, b) { a = a.toLowerCase() b = b.toLowerCase() return a > b ? 1 : a < b ? -1 : 0 } node-glob-4.0.5/test/bash-comparison.js000066400000000000000000000033221236554043100177730ustar00rootroot00000000000000// basic test // show that it does the same thing by default as the shell. var tap = require("tap") , child_process = require("child_process") , bashResults = require("./bash-results.json") , globs = Object.keys(bashResults) , glob = require("../") , path = require("path") // run from the root of the project // this is usually where you're at anyway, but be sure. process.chdir(path.resolve(__dirname, "..")) function alphasort (a, b) { a = a.toLowerCase() b = b.toLowerCase() return a > b ? 1 : a < b ? -1 : 0 } globs.forEach(function (pattern) { var expect = bashResults[pattern] // anything regarding the symlink thing will fail on windows, so just skip it if (process.platform === "win32" && expect.some(function (m) { return /\/symlink\//.test(m) })) return tap.test(pattern, function (t) { glob(pattern, function (er, matches) { if (er) throw er // sort and unmark, just to match the shell results matches = cleanResults(matches) t.deepEqual(matches, expect, pattern) t.end() }) }) tap.test(pattern + " sync", function (t) { var matches = cleanResults(glob.sync(pattern)) t.deepEqual(matches, expect, "should match shell") t.end() }) }) function cleanResults (m) { // normalize discrepancies in ordering, duplication, // and ending slashes. return m.map(function (m) { return m.replace(/\/+/g, "/").replace(/\/$/, "") }).sort(alphasort).reduce(function (set, f) { if (f !== set[set.length - 1]) set.push(f) return set }, []).sort(alphasort).map(function (f) { // de-windows return (process.platform !== 'win32') ? f : f.replace(/^[a-zA-Z]:[\/\\]+/, '/').replace(/[\\\/]+/g, '/') }) } node-glob-4.0.5/test/bash-results.json000066400000000000000000000733061236554043100176700ustar00rootroot00000000000000{ "test/a/*/+(c|g)/./d": [ "test/a/b/c/./d" ], "test/a/**/[cg]/../[cg]": [ "test/a/abcdef/g/../g", "test/a/abcfed/g/../g", "test/a/b/c/../c", "test/a/c/../c", "test/a/c/d/c/../c", "test/a/symlink/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/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c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c" ], "test/a/{b,c,d,e,f}/**/g": [], "test/a/b/**": [ "test/a/b", "test/a/b/c", "test/a/b/c/d" ], "test/**/g": [ "test/a/abcdef/g", "test/a/abcfed/g" ], "test/a/abc{fed,def}/g/h": [ "test/a/abcdef/g/h", "test/a/abcfed/g/h" ], "test/a/abc{fed/g,def}/**/": [ "test/a/abcdef", "test/a/abcdef/g", "test/a/abcfed/g" ], "test/a/abc{fed/g,def}/**///**/": [ "test/a/abcdef", "test/a/abcdef/g", "test/a/abcfed/g" ], "test/**/a/**/": [ "test/a", "test/a/abcdef", "test/a/abcdef/g", "test/a/abcfed", "test/a/abcfed/g", "test/a/b", "test/a/b/c", "test/a/bc", "test/a/bc/e", "test/a/c", "test/a/c/d", "test/a/c/d/c", "test/a/cb", "test/a/cb/e", "test/a/symlink", "test/a/symlink/a", "test/a/symlink/a/b", "test/a/symlink/a/b/c", "test/a/symlink/a/b/c/a", "test/a/symlink/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/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", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b" ], "test/+(a|b|c)/a{/,bc*}/**": [ "test/a/abcdef", "test/a/abcdef/g", "test/a/abcdef/g/h", "test/a/abcfed", "test/a/abcfed/g", "test/a/abcfed/g/h" ], "test/*/*/*/f": [ "test/a/bc/e/f", "test/a/cb/e/f" ], "test/**/f": [ "test/a/bc/e/f", "test/a/cb/e/f" ], "test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**": [ "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/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b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c" ], "{./*/*,/tmp/glob-test/*}": [ "./examples/g.js", "./examples/usr-local.js", "./node_modules/graceful-fs", "./node_modules/inherits", "./node_modules/minimatch", "./node_modules/mkdirp", "./node_modules/once", "./node_modules/rimraf", "./node_modules/tap", "./test/00-setup.js", "./test/a", "./test/bash-comparison.js", "./test/bash-results.json", "./test/cwd-test.js", "./test/empty-set.js", "./test/error-callback.js", "./test/globstar-match.js", "./test/mark.js", "./test/negation-test.js", "./test/new-glob-optional-options.js", "./test/nocase-nomagic.js", "./test/pause-resume.js", "./test/readme-issue.js", "./test/root-nomount.js", "./test/root.js", "./test/stat.js", "./test/zz-cleanup.js", "/tmp/glob-test/asdf", "/tmp/glob-test/bar", "/tmp/glob-test/baz", "/tmp/glob-test/foo", "/tmp/glob-test/quux", "/tmp/glob-test/qwer", "/tmp/glob-test/rewq" ], "{/tmp/glob-test/*,*}": [ "/tmp/glob-test/asdf", "/tmp/glob-test/bar", "/tmp/glob-test/baz", "/tmp/glob-test/foo", "/tmp/glob-test/quux", "/tmp/glob-test/qwer", "/tmp/glob-test/rewq", "examples", "glob.js", "LICENSE", "node_modules", "package.json", "README.md", "test" ], "test/a/!(symlink)/**": [ "test/a/abcdef", "test/a/abcdef/g", "test/a/abcdef/g/h", "test/a/abcfed", "test/a/abcfed/g", "test/a/abcfed/g/h", "test/a/b", "test/a/b/c", "test/a/b/c/d", "test/a/bc", "test/a/bc/e", "test/a/bc/e/f", "test/a/c", "test/a/c/d", "test/a/c/d/c", "test/a/c/d/c/b", "test/a/cb", "test/a/cb/e", "test/a/cb/e/f" ] } node-glob-4.0.5/test/cwd-test.js000066400000000000000000000022431236554043100164410ustar00rootroot00000000000000var tap = require("tap") var origCwd = process.cwd() process.chdir(__dirname) tap.test("changing cwd and searching for **/d", function (t) { var glob = require('../') var path = require('path') t.test('.', function (t) { glob('**/d', function (er, matches) { t.ifError(er) t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) t.end() }) }) t.test('a', function (t) { glob('**/d', {cwd:path.resolve('a')}, function (er, matches) { t.ifError(er) t.like(matches, [ 'b/c/d', 'c/d' ]) t.end() }) }) t.test('a/b', function (t) { glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) { t.ifError(er) t.like(matches, [ 'c/d' ]) t.end() }) }) t.test('a/b/', function (t) { glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) { t.ifError(er) t.like(matches, [ 'c/d' ]) t.end() }) }) t.test('.', function (t) { glob('**/d', {cwd: process.cwd()}, function (er, matches) { t.ifError(er) t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) t.end() }) }) t.test('cd -', function (t) { process.chdir(origCwd) t.end() }) t.end() }) node-glob-4.0.5/test/empty-set.js000066400000000000000000000006511236554043100166370ustar00rootroot00000000000000var test = require('tap').test var glob = require("../glob.js") // Patterns that cannot match anything var patterns = [ '# comment', ' ', '\n', 'just doesnt happen to match anything so this is a control' ] patterns.forEach(function (p) { test(JSON.stringify(p), function (t) { glob(p, function (e, f) { t.equal(e, null, 'no error') t.same(f, [], 'no returned values') t.end() }) }) }) node-glob-4.0.5/test/error-callback.js000066400000000000000000000007031236554043100175710ustar00rootroot00000000000000var fs try { fs = require('graceful-fs') } catch (e) { fs = require('fs') } var test = require('tap').test var glob = require('../') test('mock fs', function(t) { fs.readdir = function(path, cb) { process.nextTick(function() { cb(new Error('mock fs.readdir error')) }) } t.pass('mocked') t.end() }) test('error callback', function(t) { glob('*', function(err, res) { t.ok(err, 'expecting mock error') t.end() }) }) node-glob-4.0.5/test/globstar-match.js000066400000000000000000000007671236554043100176270ustar00rootroot00000000000000var Glob = require("../glob.js").Glob var test = require('tap').test test('globstar should not have dupe matches', function(t) { var pattern = 'a/**/[gh]' var g = new Glob(pattern, { cwd: __dirname }) var matches = [] g.on('match', function(m) { console.error('match %j', m) matches.push(m) }) g.on('end', function(set) { console.error('set', set) matches = matches.sort() set = set.sort() t.same(matches, set, 'should have same set of matches') t.end() }) }) node-glob-4.0.5/test/mark.js000066400000000000000000000052041236554043100156410ustar00rootroot00000000000000var test = require("tap").test var glob = require('../') process.chdir(__dirname) // expose timing issues var lag = 5 glob.Glob.prototype._stat = function(o) { return function(f, cb) { var args = arguments setTimeout(function() { o.call(this, f, cb) }.bind(this), lag += 5) }}(glob.Glob.prototype._stat) test("mark, with **", function (t) { glob("a/*b*/**", {mark: true}, function (er, results) { if (er) throw er var expect = [ 'a/abcdef/', 'a/abcdef/g/', 'a/abcdef/g/h', 'a/abcfed/', 'a/abcfed/g/', 'a/abcfed/g/h', 'a/b/', 'a/b/c/', 'a/b/c/d', 'a/bc/', 'a/bc/e/', 'a/bc/e/f', 'a/cb/', 'a/cb/e/', 'a/cb/e/f' ] t.same(results, expect) t.end() }) }) test("mark, no / on pattern", function (t) { glob("a/*", {mark: true}, function (er, results) { if (er) throw er var expect = [ 'a/abcdef/', 'a/abcfed/', 'a/b/', 'a/bc/', 'a/c/', 'a/cb/' ] if (process.platform !== "win32") expect.push('a/symlink/') t.same(results, expect) t.end() }).on('match', function(m) { t.similar(m, /\/$/) }) }) test("mark=false, no / on pattern", function (t) { glob("a/*", function (er, results) { if (er) throw er var expect = [ 'a/abcdef', 'a/abcfed', 'a/b', 'a/bc', 'a/c', 'a/cb' ] if (process.platform !== "win32") expect.push('a/symlink') t.same(results, expect) t.end() }).on('match', function(m) { t.similar(m, /[^\/]$/) }) }) test("mark=true, / on pattern", function (t) { glob("a/*/", {mark: true}, function (er, results) { if (er) throw er var expect = [ 'a/abcdef/', 'a/abcfed/', 'a/b/', 'a/bc/', 'a/c/', 'a/cb/' ] if (process.platform !== "win32") expect.push('a/symlink/') t.same(results, expect) t.end() }).on('match', function(m) { t.similar(m, /\/$/) }) }) test("mark=false, / on pattern", function (t) { glob("a/*/", function (er, results) { if (er) throw er var expect = [ 'a/abcdef/', 'a/abcfed/', 'a/b/', 'a/bc/', 'a/c/', 'a/cb/' ] if (process.platform !== "win32") expect.push('a/symlink/') t.same(results, expect) t.end() }).on('match', function(m) { t.similar(m, /\/$/) }) }) node-glob-4.0.5/test/negation-test.js000066400000000000000000000006651236554043100174760ustar00rootroot00000000000000// Negation test // Show that glob respect's minimatch's negate flag var glob = require('../glob.js') var test = require('tap').test test('glob respects minimatch negate flag when activated with leading !', function(t) { var expect = ["abcdef/g", "abcfed/g", "c/d", "cb/e", "symlink/a"] var results = glob("!b**/*", {cwd: 'a'}, function (er, results) { if (er) throw er t.same(results, expect) t.end() }); }); node-glob-4.0.5/test/new-glob-optional-options.js000066400000000000000000000004001236554043100217260ustar00rootroot00000000000000var Glob = require('../glob.js').Glob; var test = require('tap').test; test('new glob, with cb, and no options', function (t) { new Glob(__filename, function(er, results) { if (er) throw er; t.same(results, [__filename]); t.end(); }); }); node-glob-4.0.5/test/nocase-nomagic.js000066400000000000000000000053201236554043100175710ustar00rootroot00000000000000var fs try { fs = require('graceful-fs') } catch (e) { fs = require('fs') } var test = require('tap').test; var glob = require('../'); test('mock fs', function(t) { var stat = fs.stat var statSync = fs.statSync var readdir = fs.readdir var readdirSync = fs.readdirSync function fakeStat(path) { var ret switch (path.toLowerCase()) { case '/tmp': case '/tmp/': case 'c:\\tmp': case 'c:\\tmp\\': ret = { isDirectory: function() { return true } } break case '/tmp/a': case 'c:\\tmp\\a': ret = { isDirectory: function() { return false } } break } return ret } fs.stat = function(path, cb) { var f = fakeStat(path); if (f) { process.nextTick(function() { cb(null, f) }) } else { stat.call(fs, path, cb) } } fs.statSync = function(path) { return fakeStat(path) || statSync.call(fs, path) } function fakeReaddir(path) { var ret switch (path.toLowerCase()) { case '/tmp': case '/tmp/': case 'c:\\tmp': case 'c:\\tmp\\': ret = [ 'a', 'A' ] break case '/': case 'c:\\': ret = ['tmp', 'tMp', 'tMP', 'TMP'] } return ret } fs.readdir = function(path, cb) { var f = fakeReaddir(path) if (f) process.nextTick(function() { cb(null, f) }) else readdir.call(fs, path, cb) } fs.readdirSync = function(path) { return fakeReaddir(path) || readdirSync.call(fs, path) } t.pass('mocked') t.end() }) test('nocase, nomagic', function(t) { var n = 2 var want = [ '/TMP/A', '/TMP/a', '/tMP/A', '/tMP/a', '/tMp/A', '/tMp/a', '/tmp/A', '/tmp/a' ] if(process.platform.match(/^win/)) { want = want.map(function(p) { return 'C:' + p }) } glob('/tmp/a', { nocase: true }, function(er, res) { if (er) throw er t.same(res.sort(), want) if (--n === 0) t.end() }) glob('/tmp/A', { nocase: true }, function(er, res) { if (er) throw er t.same(res.sort(), want) if (--n === 0) t.end() }) }) test('nocase, with some magic', function(t) { t.plan(2) var want = [ '/TMP/A', '/TMP/a', '/tMP/A', '/tMP/a', '/tMp/A', '/tMp/a', '/tmp/A', '/tmp/a' ] if(process.platform.match(/^win/)) { want = want.map(function(p) { return 'C:' + p }) } glob('/tmp/*', { nocase: true }, function(er, res) { if (er) throw er t.same(res.sort(), want) }) glob('/tmp/*', { nocase: true }, function(er, res) { if (er) throw er t.same(res.sort(), want) }) }) node-glob-4.0.5/test/pause-resume.js000066400000000000000000000036361236554043100173310ustar00rootroot00000000000000// show that no match events happen while paused. var tap = require("tap") , child_process = require("child_process") // just some gnarly pattern with lots of matches , pattern = "test/a/!(symlink)/**" , bashResults = require("./bash-results.json") , patterns = Object.keys(bashResults) , glob = require("../") , Glob = glob.Glob , path = require("path") // run from the root of the project // this is usually where you're at anyway, but be sure. process.chdir(path.resolve(__dirname, "..")) function alphasort (a, b) { a = a.toLowerCase() b = b.toLowerCase() return a > b ? 1 : a < b ? -1 : 0 } function cleanResults (m) { // normalize discrepancies in ordering, duplication, // and ending slashes. return m.map(function (m) { return m.replace(/\/+/g, "/").replace(/\/$/, "") }).sort(alphasort).reduce(function (set, f) { if (f !== set[set.length - 1]) set.push(f) return set }, []).sort(alphasort).map(function (f) { // de-windows return (process.platform !== 'win32') ? f : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') }) } var globResults = [] tap.test("use a Glob object, and pause/resume it", function (t) { var g = new Glob(pattern) , paused = false , res = [] , expect = bashResults[pattern] g.on("pause", function () { console.error("pause") }) g.on("resume", function () { console.error("resume") }) g.on("match", function (m) { t.notOk(g.paused, "must not be paused") globResults.push(m) g.pause() t.ok(g.paused, "must be paused") setTimeout(g.resume.bind(g), 10) }) g.on("end", function (matches) { t.pass("reached glob end") globResults = cleanResults(globResults) matches = cleanResults(matches) t.deepEqual(matches, globResults, "end event matches should be the same as match events") t.deepEqual(matches, expect, "glob matches should be the same as bash results") t.end() }) }) node-glob-4.0.5/test/readme-issue.js000066400000000000000000000012401236554043100172660ustar00rootroot00000000000000var test = require("tap").test var glob = require("../") var mkdirp = require("mkdirp") var fs = require("fs") var rimraf = require("rimraf") var dir = __dirname + "/package" test("setup", function (t) { mkdirp.sync(dir) fs.writeFileSync(dir + "/package.json", "{}", "ascii") fs.writeFileSync(dir + "/README", "x", "ascii") t.pass("setup done") t.end() }) test("glob", function (t) { var opt = { cwd: dir, nocase: true, mark: true } glob("README?(.*)", opt, function (er, files) { if (er) throw er t.same(files, ["README"]) t.end() }) }) test("cleanup", function (t) { rimraf.sync(dir) t.pass("clean") t.end() }) node-glob-4.0.5/test/root-nomount.js000066400000000000000000000020041236554043100173620ustar00rootroot00000000000000var tap = require("tap") var origCwd = process.cwd() process.chdir(__dirname) tap.test("changing root and searching for /b*/**", function (t) { var glob = require('../') var path = require('path') t.test('.', function (t) { glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) { t.ifError(er) t.like(matches, []) t.end() }) }) t.test('a', function (t) { glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) { t.ifError(er) t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) t.end() }) }) t.test('root=a, cwd=a/b', function (t) { glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) { t.ifError(er) t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) t.end() }) }) t.test('cd -', function (t) { process.chdir(origCwd) t.end() }) t.end() }) node-glob-4.0.5/test/root.js000066400000000000000000000021371236554043100156740ustar00rootroot00000000000000var t = require("tap") var origCwd = process.cwd() process.chdir(__dirname) var glob = require('../') var path = require('path') t.test('.', function (t) { glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) { t.ifError(er) t.like(matches, []) t.end() }) }) t.test('a', function (t) { console.error("root=" + path.resolve('a')) glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) { t.ifError(er) var wanted = [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { return path.join(path.resolve('a'), m).replace(/\\/g, '/') }) t.like(matches, wanted) t.end() }) }) t.test('root=a, cwd=a/b', function (t) { glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) { t.ifError(er) t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { return path.join(path.resolve('a'), m).replace(/\\/g, '/') })) t.end() }) }) t.test('cd -', function (t) { process.chdir(origCwd) t.end() }) node-glob-4.0.5/test/stat.js000066400000000000000000000014131236554043100156600ustar00rootroot00000000000000var glob = require('../') var test = require('tap').test var path = require('path') test('stat all the things', function(t) { var g = new glob.Glob('a/*abc*/**', { stat: true, cwd: __dirname }) var matches = [] g.on('match', function(m) { matches.push(m) }) var stats = [] g.on('stat', function(m) { stats.push(m) }) g.on('end', function(eof) { stats = stats.sort() matches = matches.sort() eof = eof.sort() t.same(stats, matches) t.same(eof, matches) var cache = Object.keys(this.statCache) t.same(cache.map(function (f) { return path.relative(__dirname, f).replace(/\\/g, '/') }).sort(), matches) cache.forEach(function(c) { t.equal(typeof this.statCache[c], 'object') }, this) t.end() }) }) node-glob-4.0.5/test/zz-cleanup.js000066400000000000000000000003731236554043100170010ustar00rootroot00000000000000// remove the fixtures var tap = require("tap") , rimraf = require("rimraf") , path = require("path") tap.test("cleanup fixtures", function (t) { rimraf(path.resolve(__dirname, "a"), function (er) { t.ifError(er, "removed") t.end() }) })