Update glob and things depending on glob

This commit is contained in:
isaacs
2014-06-05 23:22:27 -07:00
parent c535eddf30
commit 57ac974e9b
13 changed files with 138 additions and 52 deletions

3
node_modules/glob/.travis.yml generated vendored
View File

@@ -1,3 +1,4 @@
language: node_js
node_js:
- 0.8
- 0.10
- 0.11

14
node_modules/glob/glob.js generated vendored
View File

@@ -44,6 +44,7 @@ var fs = require("fs")
, path = require("path")
, isDir = {}
, assert = require("assert").ok
, once = require("once")
function glob (pattern, options, cb) {
if (typeof options === "function") cb = options, options = {}
@@ -91,6 +92,7 @@ function Glob (pattern, options, cb) {
}
if (typeof cb === "function") {
cb = once(cb)
this.on("error", cb)
this.on("end", function (matches) {
cb(null, matches)
@@ -149,6 +151,10 @@ function Glob (pattern, options, cb) {
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
@@ -176,6 +182,10 @@ function Glob (pattern, options, cb) {
// 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) {
@@ -429,9 +439,9 @@ Glob.prototype._process = function (pattern, depth, index, cb_) {
if (prefix === null) read = "."
else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) {
if (!prefix || !isAbsolute(prefix)) {
prefix = path.join("/", prefix)
prefix = "/" + prefix
}
read = prefix = path.resolve(prefix)
read = prefix
// if (process.platform === "win32")
// read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/")

33
node_modules/glob/package.json generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -286,6 +286,7 @@
"./node_modules/inherits",
"./node_modules/minimatch",
"./node_modules/mkdirp",
"./node_modules/once",
"./node_modules/rimraf",
"./node_modules/tap",
"./test/00-setup.js",
@@ -293,6 +294,8 @@
"./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/new-glob-optional-options.js",

20
node_modules/glob/test/empty-set.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
var 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()
})
})
})

20
node_modules/glob/test/error-callback.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
var 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()
})
})

View File

@@ -11,10 +11,10 @@ test('mock fs', function(t) {
function fakeStat(path) {
var ret
switch (path.toLowerCase()) {
case '/tmp': case '/tmp/':
case '/tmp': case '/tmp/': case 'c:\\tmp': case 'c:\\tmp\\':
ret = { isDirectory: function() { return true } }
break
case '/tmp/a':
case '/tmp/a': case 'c:\\tmp\\a':
ret = { isDirectory: function() { return false } }
break
}
@@ -39,10 +39,10 @@ test('mock fs', function(t) {
function fakeReaddir(path) {
var ret
switch (path.toLowerCase()) {
case '/tmp': case '/tmp/':
case '/tmp': case '/tmp/': case 'c:\\tmp': case 'c:\\tmp\\':
ret = [ 'a', 'A' ]
break
case '/':
case '/': case 'c:\\':
ret = ['tmp', 'tMp', 'tMP', 'TMP']
}
return ret
@@ -76,6 +76,11 @@ test('nocase, nomagic', function(t) {
'/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
@@ -100,6 +105,12 @@ test('nocase, with some magic', function(t) {
'/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

2
node_modules/glob/test/stat.js generated vendored
View File

@@ -20,7 +20,7 @@ test('stat all the things', function(t) {
t.same(eof, matches)
var cache = Object.keys(this.statCache)
t.same(cache.map(function (f) {
return path.relative(__dirname, f)
return path.relative(__dirname, f).replace(/\\/g, '/')
}).sort(), matches)
cache.forEach(function(c) {

View File

@@ -1,6 +1,6 @@
{
"name": "init-package-json",
"version": "0.0.17",
"version": "0.1.0",
"main": "init-package-json.js",
"scripts": {
"test": "tap test/*.js"
@@ -17,11 +17,11 @@
"license": "ISC",
"description": "A node module to get your node module started",
"dependencies": {
"glob": "^4.0.2",
"promzard": "~0.2.0",
"read": "~1.0.1",
"read-package-json": "1",
"semver": "2.x",
"glob": "~3.2.7"
"semver": "2.x"
},
"devDependencies": {
"tap": "~0.2.5",
@@ -37,29 +37,14 @@
"prompt",
"start"
],
"gitHead": "cbc53fbedd4246d62ec99ea3a61a113a07d21629",
"readme": "# init-package-json\n\nA node module to get your node module started.\n\n## Usage\n\n```javascript\nvar init = require('init-package-json')\nvar path = require('path')\n\n// a path to a promzard module. In the event that this file is\n// not found, one will be provided for you.\nvar initFile = path.resolve(process.env.HOME, '.npm-init')\n\n// the dir where we're doin stuff.\nvar dir = process.cwd()\n\n// extra stuff that gets put into the PromZard module's context.\n// In npm, this is the resolved config object. Exposed as 'config'\n// Optional.\nvar configData = { some: 'extra stuff' }\n\n// Any existing stuff from the package.json file is also exposed in the\n// PromZard module as the `package` object. There will also be free\n// vars for:\n// * `filename` path to the package.json file\n// * `basename` the tip of the package dir\n// * `dirname` the parent of the package dir\n\ninit(dir, initFile, configData, function (er, data) {\n // the data's already been written to {dir}/package.json\n // now you can do stuff with it\n})\n```\n\nOr from the command line:\n\n```\n$ npm-init\n```\n\nSee [PromZard](https://github.com/isaacs/promzard) for details about\nwhat can go in the config file.\n",
"readmeFilename": "README.md",
"gitHead": "378bf828106a56e340d3017258ae372a12f0efe7",
"bugs": {
"url": "https://github.com/isaacs/init-package-json/issues"
},
"homepage": "https://github.com/isaacs/init-package-json",
"_id": "init-package-json@0.0.17",
"_shasum": "395f2cb8d1c5af93ba6ec19dafa64717047f90c3",
"_from": "init-package-json@latest",
"_npmVersion": "1.4.10",
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
"maintainers": [
{
"name": "isaacs",
"email": "i@izs.me"
}
],
"dist": {
"shasum": "395f2cb8d1c5af93ba6ec19dafa64717047f90c3",
"tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-0.0.17.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-0.0.17.tgz"
"_id": "init-package-json@0.1.0",
"_shasum": "249c982759a102556f294f2592c14a2dad855f52",
"_from": "init-package-json@latest"
}

2
node_modules/node-gyp/package.json generated vendored
View File

@@ -27,7 +27,7 @@
},
"main": "./lib/node-gyp.js",
"dependencies": {
"glob": "3",
"glob": "3 || 4",
"graceful-fs": "2",
"fstream": "0",
"minimatch": "0",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long