You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2016/08/01 22:22:38 UTC
[19/61] [abbrv] [partial] cordova-create git commit: gitignore node
modules
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/Gruntfile.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/Gruntfile.js b/node_modules/gaze/Gruntfile.js
deleted file mode 100644
index 0206147..0000000
--- a/node_modules/gaze/Gruntfile.js
+++ /dev/null
@@ -1,32 +0,0 @@
-module.exports = function(grunt) {
- 'use strict';
- grunt.initConfig({
- benchmark: {
- all: {
- src: ['benchmarks/*.js'],
- options: { times: 10 }
- }
- },
- nodeunit: {
- files: ['test/**/*_test.js'],
- },
- jshint: {
- options: {
- jshintrc: '.jshintrc'
- },
- gruntfile: {
- src: 'Gruntfile.js'
- },
- lib: {
- src: ['lib/**/*.js']
- },
- test: {
- src: ['test/**/*_test.js']
- },
- }
- });
- grunt.loadNpmTasks('grunt-benchmark');
- grunt.loadNpmTasks('grunt-contrib-jshint');
- grunt.loadNpmTasks('grunt-contrib-nodeunit');
- grunt.registerTask('default', ['jshint', 'nodeunit']);
-};
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/LICENSE-MIT
----------------------------------------------------------------------
diff --git a/node_modules/gaze/LICENSE-MIT b/node_modules/gaze/LICENSE-MIT
deleted file mode 100644
index 8c1a833..0000000
--- a/node_modules/gaze/LICENSE-MIT
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2013 Kyle Robinson Young
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/README.md
----------------------------------------------------------------------
diff --git a/node_modules/gaze/README.md b/node_modules/gaze/README.md
deleted file mode 100644
index ed2acbe..0000000
--- a/node_modules/gaze/README.md
+++ /dev/null
@@ -1,172 +0,0 @@
-# gaze [![Build Status](https://secure.travis-ci.org/shama/gaze.png?branch=master)](http://travis-ci.org/shama/gaze)
-
-A globbing fs.watch wrapper built from the best parts of other fine watch libs.
-
-Compatible with NodeJS v0.8/0.6, Windows, OSX and Linux.
-
-## Usage
-Install the module with: `npm install gaze` or place into your `package.json`
-and run `npm install`.
-
-```javascript
-var gaze = require('gaze');
-
-// Watch all .js files/dirs in process.cwd()
-gaze('**/*.js', function(err, watcher) {
- // Files have all started watching
- // watcher === this
-
- // Get all watched files
- console.log(this.watched());
-
- // On file changed
- this.on('changed', function(filepath) {
- console.log(filepath + ' was changed');
- });
-
- // On file added
- this.on('added', function(filepath) {
- console.log(filepath + ' was added');
- });
-
- // On file deleted
- this.on('deleted', function(filepath) {
- console.log(filepath + ' was deleted');
- });
-
- // On changed/added/deleted
- this.on('all', function(event, filepath) {
- console.log(filepath + ' was ' + event);
- });
-
- // Get watched files with relative paths
- console.log(this.relative());
-});
-
-// Also accepts an array of patterns
-gaze(['stylesheets/*.css', 'images/**/*.png'], function() {
- // Add more patterns later to be watched
- this.add(['js/*.js']);
-});
-```
-
-### Alternate Interface
-
-```javascript
-var Gaze = require('gaze').Gaze;
-
-var gaze = new Gaze('**/*');
-
-// Files have all started watching
-gaze.on('ready', function(watcher) { });
-
-// A file has been added/changed/deleted has occurred
-gaze.on('all', function(event, filepath) { });
-```
-
-### Errors
-
-```javascript
-gaze('**/*', function() {
- this.on('error', function(err) {
- // Handle error here
- });
-});
-```
-
-### Minimatch / Glob
-
-See [isaacs's minimatch](https://github.com/isaacs/minimatch) for more
-information on glob patterns.
-
-## Documentation
-
-### gaze(patterns, [options], callback)
-
-* `patterns` {String|Array} File patterns to be matched
-* `options` {Object}
-* `callback` {Function}
- * `err` {Error | null}
- * `watcher` {Object} Instance of the Gaze watcher
-
-### Class: gaze.Gaze
-
-Create a Gaze object by instanting the `gaze.Gaze` class.
-
-```javascript
-var Gaze = require('gaze').Gaze;
-var gaze = new Gaze(pattern, options, callback);
-```
-
-#### Properties
-
-* `options` The options object passed in.
- * `interval` {integer} Interval to pass to fs.watchFile
- * `debounceDelay` {integer} Delay for events called in succession for the same
- file/event
-
-#### Events
-
-* `ready(watcher)` When files have been globbed and watching has begun.
-* `all(event, filepath)` When an `added`, `changed` or `deleted` event occurs.
-* `added(filepath)` When a file has been added to a watch directory.
-* `changed(filepath)` When a file has been changed.
-* `deleted(filepath)` When a file has been deleted.
-* `renamed(newPath, oldPath)` When a file has been renamed.
-* `end()` When the watcher is closed and watches have been removed.
-* `error(err)` When an error occurs.
-
-#### Methods
-
-* `emit(event, [...])` Wrapper for the EventEmitter.emit.
- `added`|`changed`|`deleted` events will also trigger the `all` event.
-* `close()` Unwatch all files and reset the watch instance.
-* `add(patterns, callback)` Adds file(s) patterns to be watched.
-* `remove(filepath)` removes a file or directory from being watched. Does not
- recurse directories.
-* `watched()` Returns the currently watched files.
-* `relative([dir, unixify])` Returns the currently watched files with relative paths.
- * `dir` {string} Only return relative files for this directory.
- * `unixify` {boolean} Return paths with `/` instead of `\\` if on Windows.
-
-## FAQs
-
-### Why Another `fs.watch` Wrapper?
-I liked parts of other `fs.watch` wrappers but none had all the features I
-needed. This lib combines the features I needed from other fine watch libs:
-Speedy data behavior from
-[paulmillr's chokidar](https://github.com/paulmillr/chokidar), API interface
-from [mikeal's watch](https://github.com/mikeal/watch) and file globbing using
-[isaacs's glob](https://github.com/isaacs/node-glob) which is also used by
-[cowboy's Grunt](https://github.com/gruntjs/grunt).
-
-### How do I fix the error `EMFILE: Too many opened files.`?
-This is because of your system's max opened file limit. For OSX the default is
-very low (256). Increase your limit temporarily with `ulimit -n 10480`, the
-number being the new max limit.
-
-## Contributing
-In lieu of a formal styleguide, take care to maintain the existing coding style.
-Add unit tests for any new or changed functionality. Lint and test your code
-using [grunt](http://gruntjs.com/).
-
-## Release History
-* 0.3.4 - Code clean up. Fix path must be strings errors (@groner). Fix incorrect added events (@groner).
-* 0.3.3 - Fix for multiple patterns with negate.
-* 0.3.2 - Emit `end` before removeAllListeners.
-* 0.3.1 - Fix added events within subfolder patterns.
-* 0.3.0 - Handle safewrite events, `forceWatchMethod` option removed, bug fixes and watch optimizations (@rgaskill).
-* 0.2.2 - Fix issue where subsequent add calls dont get watched (@samcday). removeAllListeners on close.
-* 0.2.1 - Fix issue with invalid `added` events in current working dir.
-* 0.2.0 - Support and mark folders with `path.sep`. Add `forceWatchMethod` option. Support `renamed` events.
-* 0.1.6 - Recognize the `cwd` option properly
-* 0.1.5 - Catch too many open file errors
-* 0.1.4 - Really fix the race condition with 2 watches
-* 0.1.3 - Fix race condition with 2 watches
-* 0.1.2 - Read triggering changed event fix
-* 0.1.1 - Minor fixes
-* 0.1.0 - Initial release
-
-## License
-Copyright (c) 2013 Kyle Robinson Young
-Licensed under the MIT license.
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/benchmarks/gaze100s.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/benchmarks/gaze100s.js b/node_modules/gaze/benchmarks/gaze100s.js
deleted file mode 100644
index 1ada219..0000000
--- a/node_modules/gaze/benchmarks/gaze100s.js
+++ /dev/null
@@ -1,46 +0,0 @@
-'use strict';
-
-var gaze = require('../lib/gaze');
-var grunt = require('grunt');
-var path = require('path');
-
-// Folder to watch
-var watchDir = path.resolve(__dirname, 'watch');
-
-// Helper for creating mock files
-function createFiles(num, dir) {
- for (var i = 0; i < num; i++) {
- grunt.file.write(path.join(dir, 'test-' + i + '.js'), 'var test = ' + i + ';');
- }
-}
-
-module.exports = {
- 'setUp': function(done) {
- // ensure that your `ulimit -n` is higher than amount of files
- if (grunt.file.exists(watchDir)) {
- grunt.file.delete(watchDir, {force:true});
- }
- createFiles(100, path.join(watchDir, 'one'));
- createFiles(100, path.join(watchDir, 'two'));
- createFiles(100, path.join(watchDir, 'three'));
- createFiles(100, path.join(watchDir, 'three', 'four'));
- createFiles(100, path.join(watchDir, 'three', 'four', 'five', 'six'));
- process.chdir(watchDir);
- done();
- },
- 'tearDown': function(done) {
- if (grunt.file.exists(watchDir)) {
- grunt.file.delete(watchDir, {force:true});
- }
- done();
- },
- changed: function(done) {
- gaze('**/*', {maxListeners:0}, function(err, watcher) {
- this.on('changed', done);
- setTimeout(function() {
- var rand = String(new Date().getTime()).replace(/[^\w]+/g, '');
- grunt.file.write(path.join(watchDir, 'one', 'test-99.js'), 'var test = "' + rand + '"');
- }, 100);
- });
- }
-};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/lib/gaze.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/lib/gaze.js b/node_modules/gaze/lib/gaze.js
deleted file mode 100644
index 85da897..0000000
--- a/node_modules/gaze/lib/gaze.js
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- * gaze
- * https://github.com/shama/gaze
- *
- * Copyright (c) 2013 Kyle Robinson Young
- * Licensed under the MIT license.
- */
-
-'use strict';
-
-// libs
-var util = require('util');
-var EE = require('events').EventEmitter;
-var fs = require('fs');
-var path = require('path');
-var fileset = require('fileset');
-var minimatch = require('minimatch');
-
-// globals
-var delay = 10;
-
-// `Gaze` EventEmitter object to return in the callback
-function Gaze(patterns, opts, done) {
- var _this = this;
- EE.call(_this);
-
- // If second arg is the callback
- if (typeof opts === 'function') {
- done = opts;
- opts = {};
- }
-
- // Default options
- opts = opts || {};
- opts.mark = true;
- opts.interval = opts.interval || 100;
- opts.debounceDelay = opts.debounceDelay || 500;
- opts.cwd = opts.cwd || process.cwd();
- this.options = opts;
-
- // Default done callback
- done = done || function() {};
-
- // Remember our watched dir:files
- this._watched = Object.create(null);
-
- // Store watchers
- this._watchers = Object.create(null);
-
- // Store patterns
- this._patterns = [];
-
- // Cached events for debouncing
- this._cached = Object.create(null);
-
- // Set maxListeners
- if (this.options.maxListeners) {
- this.setMaxListeners(this.options.maxListeners);
- Gaze.super_.prototype.setMaxListeners(this.options.maxListeners);
- delete this.options.maxListeners;
- }
-
- // Initialize the watch on files
- if (patterns) {
- this.add(patterns, done);
- }
-
- return this;
-}
-util.inherits(Gaze, EE);
-
-// Main entry point. Start watching and call done when setup
-module.exports = function gaze(patterns, opts, done) {
- return new Gaze(patterns, opts, done);
-};
-module.exports.Gaze = Gaze;
-
-// Node v0.6 compat
-fs.existsSync = fs.existsSync || path.existsSync;
-path.sep = path.sep || path.normalize('/');
-
-/**
- * Lo-Dash 1.0.1 <http://lodash.com/>
- * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.4.4 <http://underscorejs.org/>
- * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
- * Available under MIT license <http://lodash.com/license>
- */
-function unique() { var array = Array.prototype.concat.apply(Array.prototype, arguments); var result = []; for (var i = 0; i < array.length; i++) { if (result.indexOf(array[i]) === -1) { result.push(array[i]); } } return result; }
-
-/**
- * Copyright (c) 2010 Caolan McMahon
- * Available under MIT license <https://raw.github.com/caolan/async/master/LICENSE>
- */
-function forEachSeries(arr, iterator, callback) {
- if (!arr.length) { return callback(); }
- var completed = 0;
- var iterate = function() {
- iterator(arr[completed], function (err) {
- if (err) {
- callback(err);
- callback = function() {};
- } else {
- completed += 1;
- if (completed === arr.length) {
- callback(null);
- } else {
- iterate();
- }
- }
- });
- };
- iterate();
-}
-
-// other helpers
-
-// Returns boolean whether filepath is dir terminated
-function _isDir(dir) {
- if (typeof dir !== 'string') { return false; }
- return (dir.slice(-(path.sep.length)) === path.sep);
-}
-
-// Create a `key:[]` if doesnt exist on `obj` then push or concat the `val`
-function _objectPush(obj, key, val) {
- if (obj[key] == null) { obj[key] = []; }
- if (Array.isArray(val)) { obj[key] = obj[key].concat(val); }
- else if (val) { obj[key].push(val); }
- return obj[key] = unique(obj[key]);
-}
-
-// Ensures the dir is marked with path.sep
-function _markDir(dir) {
- if (typeof dir === 'string' &&
- dir.slice(-(path.sep.length)) !== path.sep &&
- dir !== '.') {
- dir += path.sep;
- }
- return dir;
-}
-
-// Changes path.sep to unix ones for testing
-function _unixifyPathSep(filepath) {
- return (process.platform === 'win32') ? String(filepath).replace(/\\/g, '/') : filepath;
-}
-
-// Override the emit function to emit `all` events
-// and debounce on duplicate events per file
-Gaze.prototype.emit = function() {
- var _this = this;
- var args = arguments;
-
- var e = args[0];
- var filepath = args[1];
- var timeoutId;
-
- // If not added/deleted/changed/renamed then just emit the event
- if (e.slice(-2) !== 'ed') {
- Gaze.super_.prototype.emit.apply(_this, args);
- return this;
- }
-
- // Detect rename event, if added and previous deleted is in the cache
- if (e === 'added') {
- Object.keys(this._cached).forEach(function(oldFile) {
- if (_this._cached[oldFile].indexOf('deleted') !== -1) {
- args[0] = e = 'renamed';
- [].push.call(args, oldFile);
- delete _this._cached[oldFile];
- return false;
- }
- });
- }
-
- // If cached doesnt exist, create a delay before running the next
- // then emit the event
- var cache = this._cached[filepath] || [];
- if (cache.indexOf(e) === -1) {
- _objectPush(_this._cached, filepath, e);
- clearTimeout(timeoutId);
- timeoutId = setTimeout(function() {
- delete _this._cached[filepath];
- }, this.options.debounceDelay);
- // Emit the event and `all` event
- Gaze.super_.prototype.emit.apply(_this, args);
- Gaze.super_.prototype.emit.apply(_this, ['all', e].concat([].slice.call(args, 1)));
- }
-
- return this;
-};
-
-// Close watchers
-Gaze.prototype.close = function(_reset) {
- var _this = this;
- _reset = _reset === false ? false : true;
- Object.keys(_this._watchers).forEach(function(file) {
- _this._watchers[file].close();
- });
- _this._watchers = Object.create(null);
- Object.keys(this._watched).forEach(function(dir) {
- fs.unwatchFile(dir);
- _this._watched[dir].forEach(function(uFile) {
- fs.unwatchFile(uFile);
- });
- });
- if (_reset) {
- _this._watched = Object.create(null);
- setTimeout(function() {
- _this.emit('end');
- _this.removeAllListeners();
- }, delay + 100);
- }
- return _this;
-};
-
-// Add file patterns to be watched
-Gaze.prototype.add = function(files, done) {
- var _this = this;
- if (typeof files === 'string') {
- files = [files];
- }
- this._patterns = unique.apply(null, [this._patterns, files]);
-
- var include = [], exclude = [];
- this._patterns.forEach(function(p) {
- if (p.slice(0, 1) === '!') {
- exclude.push(p.slice(1));
- } else {
- include.push(p);
- }
- });
-
- fileset(include, exclude, _this.options, function(err, files) {
- if (err) {
- _this.emit('error', err);
- return done(err);
- }
- _this._addToWatched(files);
- _this.close(false);
- _this._initWatched(done);
- });
-};
-
-// Remove file/dir from `watched`
-Gaze.prototype.remove = function(file) {
- var _this = this;
- if (this._watched[file]) {
- // is dir, remove all files
- fs.unwatchFile(file);
- this._watched[file].forEach(fs.unwatchFile);
- delete this._watched[file];
- } else {
- // is a file, find and remove
- Object.keys(this._watched).forEach(function(dir) {
- var index = _this._watched[dir].indexOf(file);
- if (index !== -1) {
- fs.unwatchFile(file);
- _this._watched[dir].splice(index, 1);
- return false;
- }
- });
- }
- if (this._watchers[file]) {
- this._watchers[file].close();
- }
- return this;
-};
-
-// Return watched files
-Gaze.prototype.watched = function() {
- return this._watched;
-};
-
-// Returns `watched` files with relative paths to process.cwd()
-Gaze.prototype.relative = function(dir, unixify) {
- var _this = this;
- var relative = Object.create(null);
- var relDir, relFile, unixRelDir;
- var cwd = this.options.cwd || process.cwd();
- if (dir === '') { dir = '.'; }
- dir = _markDir(dir);
- unixify = unixify || false;
- Object.keys(this._watched).forEach(function(dir) {
- relDir = path.relative(cwd, dir) + path.sep;
- if (relDir === path.sep) { relDir = '.'; }
- unixRelDir = unixify ? _unixifyPathSep(relDir) : relDir;
- relative[unixRelDir] = _this._watched[dir].map(function(file) {
- relFile = path.relative(path.join(cwd, relDir), file);
- if (_isDir(file)) {
- relFile = _markDir(relFile);
- }
- if (unixify) {
- relFile = _unixifyPathSep(relFile);
- }
- return relFile;
- });
- });
- if (dir && unixify) {
- dir = _unixifyPathSep(dir);
- }
- return dir ? relative[dir] || [] : relative;
-};
-
-// Adds files and dirs to watched
-Gaze.prototype._addToWatched = function(files) {
- var _this = this;
- files.forEach(function(file) {
- var filepath = path.resolve(_this.options.cwd, file);
- if (file.slice(-1) === '/') { filepath += path.sep; }
- _objectPush(_this._watched, path.dirname(filepath) + path.sep, filepath);
- });
- return this;
-};
-
-// Returns true if the file matches this._patterns
-Gaze.prototype._isMatch = function(file) {
- var include = [], exclude = [];
- this._patterns.forEach(function(p) {
- if (p.slice(0, 1) === '!') {
- exclude.push(p.slice(1));
- } else {
- include.push(p);
- }
- });
- var matched = false, i = 0;
- for (i = 0; i < include.length; i++) {
- if (minimatch(file, include[i])) {
- matched = true;
- break;
- }
- }
- for (i = 0; i < exclude.length; i++) {
- if (minimatch(file, exclude[i])) {
- matched = false;
- break;
- }
- }
- return matched;
-};
-
-Gaze.prototype._watchDir = function(dir, done) {
- var _this = this;
- try {
- _this._watchers[dir] = fs.watch(dir, function(event) {
- // race condition. Let's give the fs a little time to settle down. so we
- // don't fire events on non existent files.
- setTimeout(function() {
- if (fs.existsSync(dir)) {
- done(null, dir);
- }
- }, delay + 100);
- });
- } catch (err) {
- return this._handleError(err);
- }
- return this;
-};
-
-Gaze.prototype._pollFile = function(file, done) {
- var _this = this;
- var opts = { persistent: true, interval: _this.options.interval };
- try {
- fs.watchFile(file, opts, function(curr, prev) {
- done(null, file);
- });
- } catch (err) {
- return this._handleError(err);
- }
- return this;
-};
-
-// Initialize the actual watch on `watched` files
-Gaze.prototype._initWatched = function(done) {
- var _this = this;
- var cwd = this.options.cwd || process.cwd();
- var curWatched = Object.keys(_this._watched);
- forEachSeries(curWatched, function(dir, next) {
- var files = _this._watched[dir];
- // Triggered when a watched dir has an event
- _this._watchDir(dir, function(event, dirpath) {
- var relDir = cwd === dir ? '.' : path.relative(cwd, dir);
-
- fs.readdir(dirpath, function(err, current) {
- if (err) { return _this.emit('error', err); }
- if (!current) { return; }
-
- try {
- // append path.sep to directories so they match previous.
- current = current.map(function(curPath) {
- if (fs.existsSync(path.join(dir, curPath)) && fs.statSync(path.join(dir, curPath)).isDirectory()) {
- return curPath + path.sep;
- } else {
- return curPath;
- }
- });
- } catch (err) {
- // race condition-- sometimes the file no longer exists
- }
-
- // Get watched files for this dir
- var previous = _this.relative(relDir);
-
- // If file was deleted
- previous.filter(function(file) {
- return current.indexOf(file) < 0;
- }).forEach(function(file) {
- if (!_isDir(file)) {
- var filepath = path.join(dir, file);
- _this.remove(filepath);
- _this.emit('deleted', filepath);
- }
- });
-
- // If file was added
- current.filter(function(file) {
- return previous.indexOf(file) < 0;
- }).forEach(function(file) {
- // Is it a matching pattern?
- var relFile = path.join(relDir, file);
- // TODO: this can be optimized more
- // we shouldnt need isMatch() and could just use add()
- if (_this._isMatch(relFile)) {
- // Add to watch then emit event
- _this.add(relFile, function() {
- _this.emit('added', path.join(dir, file));
- });
- }
- });
-
- });
- });
-
- // Watch for change/rename events on files
- files.forEach(function(file) {
- if (_isDir(file)) { return; }
- _this._pollFile(file, function(err, filepath) {
- // Only emit changed if the file still exists
- // Prevents changed/deleted duplicate events
- // TODO: This ignores changed events on folders, maybe support this?
- // When a file is added, a folder changed event emits first
- if (fs.existsSync(filepath)) {
- _this.emit('changed', filepath);
- }
- });
- });
-
- next();
- }, function() {
-
- // Return this instance of Gaze
- // delay before ready solves a lot of issues
- setTimeout(function() {
- _this.emit('ready', _this);
- done.call(_this, null, _this);
- }, delay + 100);
-
- });
-};
-
-// If an error, handle it here
-Gaze.prototype._handleError = function(err) {
- if (err.code === 'EMFILE') {
- return this.emit('error', new Error('EMFILE: Too many opened files.'));
- }
- return this.emit('error', err);
-};
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/package.json
----------------------------------------------------------------------
diff --git a/node_modules/gaze/package.json b/node_modules/gaze/package.json
deleted file mode 100644
index 8a33df9..0000000
--- a/node_modules/gaze/package.json
+++ /dev/null
@@ -1,119 +0,0 @@
-{
- "_args": [
- [
- {
- "name": "gaze",
- "raw": "gaze@~0.3.2",
- "rawSpec": "~0.3.2",
- "scope": null,
- "spec": ">=0.3.2 <0.4.0",
- "type": "range"
- },
- "/Users/ctran/cordova/cordova-lib/cordova-create/node_modules/jasmine-node"
- ]
- ],
- "_from": "gaze@>=0.3.2 <0.4.0",
- "_id": "gaze@0.3.4",
- "_inCache": true,
- "_installable": true,
- "_location": "/gaze",
- "_npmUser": {
- "email": "kyle@dontkry.com",
- "name": "shama"
- },
- "_npmVersion": "1.2.18",
- "_phantomChildren": {},
- "_requested": {
- "name": "gaze",
- "raw": "gaze@~0.3.2",
- "rawSpec": "~0.3.2",
- "scope": null,
- "spec": ">=0.3.2 <0.4.0",
- "type": "range"
- },
- "_requiredBy": [
- "/jasmine-node"
- ],
- "_resolved": "https://registry.npmjs.org/gaze/-/gaze-0.3.4.tgz",
- "_shasum": "5f94bdda0afe53bc710969bcd6f282548d60c279",
- "_shrinkwrap": null,
- "_spec": "gaze@~0.3.2",
- "_where": "/Users/ctran/cordova/cordova-lib/cordova-create/node_modules/jasmine-node",
- "author": {
- "email": "kyle@dontkry.com",
- "name": "Kyle Robinson Young"
- },
- "bugs": {
- "url": "https://github.com/shama/gaze/issues"
- },
- "contributors": [
- {
- "name": "Kyle Robinson Young",
- "url": "http://dontkry.com"
- },
- {
- "name": "Sam Day",
- "url": "http://sam.is-super-awesome.com"
- },
- {
- "name": "Roarke Gaskill",
- "url": "http://starkinvestments.com"
- },
- {
- "name": "Lance Pollard",
- "url": "http://lancepollard.com/"
- },
- {
- "name": "Daniel Fagnan",
- "url": "http://hydrocodedesign.com/"
- }
- ],
- "dependencies": {
- "fileset": "~0.1.5",
- "minimatch": "~0.2.9"
- },
- "description": "A globbing fs.watch wrapper built from the best parts of other fine watch libs.",
- "devDependencies": {
- "grunt": "~0.4.0rc7",
- "grunt-benchmark": "~0.1.1",
- "grunt-contrib-jshint": "~0.1.1rc6",
- "grunt-contrib-nodeunit": "~0.1.2rc6"
- },
- "directories": {},
- "dist": {
- "shasum": "5f94bdda0afe53bc710969bcd6f282548d60c279",
- "tarball": "https://registry.npmjs.org/gaze/-/gaze-0.3.4.tgz"
- },
- "engines": {
- "node": ">= 0.6.0"
- },
- "homepage": "https://github.com/shama/gaze",
- "keywords": [
- "watch",
- "glob"
- ],
- "licenses": [
- {
- "type": "MIT",
- "url": "https://github.com/shama/gaze/blob/master/LICENSE-MIT"
- }
- ],
- "main": "lib/gaze",
- "maintainers": [
- {
- "email": "kyle@dontkry.com",
- "name": "shama"
- }
- ],
- "name": "gaze",
- "optionalDependencies": {},
- "readme": "ERROR: No README data found!",
- "repository": {
- "type": "git",
- "url": "git://github.com/shama/gaze.git"
- },
- "scripts": {
- "test": "grunt nodeunit -v"
- },
- "version": "0.3.4"
-}
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/add_test.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/add_test.js b/node_modules/gaze/test/add_test.js
deleted file mode 100644
index 6949ac9..0000000
--- a/node_modules/gaze/test/add_test.js
+++ /dev/null
@@ -1,50 +0,0 @@
-'use strict';
-
-var Gaze = require('../lib/gaze.js').Gaze;
-var path = require('path');
-var fs = require('fs');
-
-exports.add = {
- setUp: function(done) {
- process.chdir(path.resolve(__dirname, 'fixtures'));
- done();
- },
- addToWatched: function(test) {
- test.expect(1);
- var files = [
- 'Project (LO)/',
- 'Project (LO)/one.js',
- 'nested/',
- 'nested/one.js',
- 'nested/three.js',
- 'nested/sub/',
- 'nested/sub/two.js',
- 'one.js'
- ];
- var expected = {
- 'Project (LO)/': ['one.js'],
- '.': ['Project (LO)/', 'nested/', 'one.js'],
- 'nested/': ['one.js', 'three.js', 'sub/'],
- 'nested/sub/': ['two.js']
- };
- var gaze = new Gaze('addnothingtowatch');
- gaze._addToWatched(files);
- test.deepEqual(gaze.relative(null, true), expected);
- test.done();
- },
- addLater: function(test) {
- test.expect(3);
- new Gaze('sub/one.js', function(err, watcher) {
- test.deepEqual(watcher.relative('sub'), ['one.js']);
- watcher.add('sub/*.js', function() {
- test.deepEqual(watcher.relative('sub'), ['one.js', 'two.js']);
- watcher.on('changed', function(filepath) {
- test.equal('two.js', path.basename(filepath));
- watcher.close();
- test.done();
- });
- fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'two.js'), 'var two = true;');
- });
- });
- }
-};
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/api_test.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/api_test.js b/node_modules/gaze/test/api_test.js
deleted file mode 100644
index 42d258e..0000000
--- a/node_modules/gaze/test/api_test.js
+++ /dev/null
@@ -1,38 +0,0 @@
-'use strict';
-
-var gaze = require('../lib/gaze.js');
-var path = require('path');
-
-exports.api = {
- setUp: function(done) {
- process.chdir(path.resolve(__dirname, 'fixtures'));
- done();
- },
- newGaze: function(test) {
- test.expect(2);
- new gaze.Gaze('**/*', {}, function() {
- var result = this.relative(null, true);
- test.deepEqual(result['.'], ['Project (LO)/', 'nested/', 'one.js', 'sub/']);
- test.deepEqual(result['sub/'], ['one.js', 'two.js']);
- this.close();
- test.done();
- });
- },
- func: function(test) {
- test.expect(1);
- var g = gaze('**/*', function(err, watcher) {
- test.deepEqual(watcher.relative('sub', true), ['one.js', 'two.js']);
- g.close();
- test.done();
- });
- },
- ready: function(test) {
- test.expect(1);
- var g = new gaze.Gaze('**/*');
- g.on('ready', function(watcher) {
- test.deepEqual(watcher.relative('sub', true), ['one.js', 'two.js']);
- this.close();
- test.done();
- });
- }
-};
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/fixtures/Project (LO)/one.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/fixtures/Project (LO)/one.js b/node_modules/gaze/test/fixtures/Project (LO)/one.js
deleted file mode 100644
index fefeeea..0000000
--- a/node_modules/gaze/test/fixtures/Project (LO)/one.js
+++ /dev/null
@@ -1 +0,0 @@
-var one = true;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/fixtures/nested/one.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/fixtures/nested/one.js b/node_modules/gaze/test/fixtures/nested/one.js
deleted file mode 100644
index fefeeea..0000000
--- a/node_modules/gaze/test/fixtures/nested/one.js
+++ /dev/null
@@ -1 +0,0 @@
-var one = true;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/fixtures/nested/sub/two.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/fixtures/nested/sub/two.js b/node_modules/gaze/test/fixtures/nested/sub/two.js
deleted file mode 100644
index 24ad8a3..0000000
--- a/node_modules/gaze/test/fixtures/nested/sub/two.js
+++ /dev/null
@@ -1 +0,0 @@
-var two = true;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/fixtures/nested/sub2/two.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/fixtures/nested/sub2/two.js b/node_modules/gaze/test/fixtures/nested/sub2/two.js
deleted file mode 100644
index 24ad8a3..0000000
--- a/node_modules/gaze/test/fixtures/nested/sub2/two.js
+++ /dev/null
@@ -1 +0,0 @@
-var two = true;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/fixtures/nested/three.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/fixtures/nested/three.js b/node_modules/gaze/test/fixtures/nested/three.js
deleted file mode 100644
index 3392956..0000000
--- a/node_modules/gaze/test/fixtures/nested/three.js
+++ /dev/null
@@ -1 +0,0 @@
-var three = true;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/fixtures/one.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/fixtures/one.js b/node_modules/gaze/test/fixtures/one.js
deleted file mode 100644
index 517f09f..0000000
--- a/node_modules/gaze/test/fixtures/one.js
+++ /dev/null
@@ -1 +0,0 @@
-var test = true;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/fixtures/sub/one.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/fixtures/sub/one.js b/node_modules/gaze/test/fixtures/sub/one.js
deleted file mode 100644
index fefeeea..0000000
--- a/node_modules/gaze/test/fixtures/sub/one.js
+++ /dev/null
@@ -1 +0,0 @@
-var one = true;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/fixtures/sub/two.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/fixtures/sub/two.js b/node_modules/gaze/test/fixtures/sub/two.js
deleted file mode 100644
index 24ad8a3..0000000
--- a/node_modules/gaze/test/fixtures/sub/two.js
+++ /dev/null
@@ -1 +0,0 @@
-var two = true;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/matching_test.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/matching_test.js b/node_modules/gaze/test/matching_test.js
deleted file mode 100644
index 9e01cd2..0000000
--- a/node_modules/gaze/test/matching_test.js
+++ /dev/null
@@ -1,57 +0,0 @@
-'use strict';
-
-var gaze = require('../lib/gaze.js');
-var path = require('path');
-
-exports.matching = {
- setUp: function(done) {
- process.chdir(path.resolve(__dirname, 'fixtures'));
- done();
- },
- globAll: function(test) {
- test.expect(2);
- gaze('**/*', function() {
- var result = this.relative(null, true);
- test.deepEqual(result['.'], ['Project (LO)/', 'nested/', 'one.js', 'sub/']);
- test.deepEqual(result['sub/'], ['one.js', 'two.js']);
- this.close();
- test.done();
- });
- },
- relativeDir: function(test) {
- test.expect(1);
- gaze('**/*', function() {
- test.deepEqual(this.relative('sub', true), ['one.js', 'two.js']);
- this.close();
- test.done();
- });
- },
- globArray: function(test) {
- test.expect(2);
- gaze(['*.js', 'sub/*.js'], function() {
- var result = this.relative(null, true);
- test.deepEqual(result['.'], ['one.js']);
- test.deepEqual(result['sub/'], ['one.js', 'two.js']);
- this.close();
- test.done();
- });
- },
- globArrayDot: function(test) {
- test.expect(1);
- gaze(['./sub/*.js'], function() {
- var result = this.relative(null, true);
- test.deepEqual(result['sub/'], ['one.js', 'two.js']);
- this.close();
- test.done();
- });
- },
- oddName: function(test) {
- test.expect(1);
- gaze(['Project (LO)/*.js'], function() {
- var result = this.relative(null, true);
- test.deepEqual(result['Project (LO)/'], ['one.js']);
- this.close();
- test.done();
- });
- }
-};
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/patterns_test.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/patterns_test.js b/node_modules/gaze/test/patterns_test.js
deleted file mode 100644
index 46b94e4..0000000
--- a/node_modules/gaze/test/patterns_test.js
+++ /dev/null
@@ -1,42 +0,0 @@
-'use strict';
-
-var gaze = require('../lib/gaze.js');
-var path = require('path');
-var fs = require('fs');
-
-// Clean up helper to call in setUp and tearDown
-function cleanUp(done) {
- [
- 'added.js',
- 'nested/added.js',
- ].forEach(function(d) {
- var p = path.resolve(__dirname, 'fixtures', d);
- if (fs.existsSync(p)) { fs.unlinkSync(p); }
- });
- done();
-}
-
-exports.patterns = {
- setUp: function(done) {
- process.chdir(path.resolve(__dirname, 'fixtures'));
- cleanUp(done);
- },
- tearDown: cleanUp,
- negate: function(test) {
- test.expect(1);
- gaze(['**/*.js', '!nested/**/*.js'], function(err, watcher) {
- watcher.on('added', function(filepath) {
- var expected = path.relative(process.cwd(), filepath);
- test.equal(path.join('added.js'), expected);
- watcher.close();
- });
- // dont add
- fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'nested', 'added.js'), 'var added = true;');
- setTimeout(function() {
- // should add
- fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'added.js'), 'var added = true;');
- }, 1000);
- watcher.on('end', test.done);
- });
- }
-};
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/relative_test.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/relative_test.js b/node_modules/gaze/test/relative_test.js
deleted file mode 100644
index 52e5a57..0000000
--- a/node_modules/gaze/test/relative_test.js
+++ /dev/null
@@ -1,28 +0,0 @@
-'use strict';
-
-var Gaze = require('../lib/gaze.js').Gaze;
-var path = require('path');
-
-exports.relative = {
- setUp: function(done) {
- process.chdir(path.resolve(__dirname, 'fixtures'));
- done();
- },
- relative: function(test) {
- test.expect(1);
- var files = [
- 'Project (LO)/',
- 'Project (LO)/one.js',
- 'nested/',
- 'nested/one.js',
- 'nested/three.js',
- 'nested/sub/',
- 'nested/sub/two.js',
- 'one.js'
- ];
- var gaze = new Gaze('addnothingtowatch');
- gaze._addToWatched(files);
- test.deepEqual(gaze.relative('.', true), ['Project (LO)/', 'nested/', 'one.js']);
- test.done();
- }
-};
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/rename_test.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/rename_test.js b/node_modules/gaze/test/rename_test.js
deleted file mode 100644
index 028b344..0000000
--- a/node_modules/gaze/test/rename_test.js
+++ /dev/null
@@ -1,43 +0,0 @@
-'use strict';
-
-var gaze = require('../lib/gaze.js');
-var path = require('path');
-var fs = require('fs');
-
-// Node v0.6 compat
-fs.existsSync = fs.existsSync || path.existsSync;
-
-// Clean up helper to call in setUp and tearDown
-function cleanUp(done) {
- [
- 'sub/rename.js',
- 'sub/renamed.js'
- ].forEach(function(d) {
- var p = path.resolve(__dirname, 'fixtures', d);
- if (fs.existsSync(p)) { fs.unlinkSync(p); }
- });
- done();
-}
-
-exports.watch = {
- setUp: function(done) {
- process.chdir(path.resolve(__dirname, 'fixtures'));
- cleanUp(done);
- },
- tearDown: cleanUp,
- rename: function(test) {
- test.expect(2);
- var oldPath = path.join(__dirname, 'fixtures', 'sub', 'rename.js');
- var newPath = path.join(__dirname, 'fixtures', 'sub', 'renamed.js');
- fs.writeFileSync(oldPath, 'var rename = true;');
- gaze('**/*', function(err, watcher) {
- watcher.on('renamed', function(newFile, oldFile) {
- test.equal(newFile, newPath);
- test.equal(oldFile, oldPath);
- watcher.close();
- test.done();
- });
- fs.renameSync(oldPath, newPath);
- });
- }
-};
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/safewrite_test.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/safewrite_test.js b/node_modules/gaze/test/safewrite_test.js
deleted file mode 100644
index 9200f11..0000000
--- a/node_modules/gaze/test/safewrite_test.js
+++ /dev/null
@@ -1,61 +0,0 @@
-'use strict';
-
-var gaze = require('../lib/gaze.js');
-var path = require('path');
-var fs = require('fs');
-
-// Node v0.6 compat
-fs.existsSync = fs.existsSync || path.existsSync;
-
-// Clean up helper to call in setUp and tearDown
-function cleanUp(done) {
- [
- 'safewrite.js'
- ].forEach(function(d) {
- var p = path.resolve(__dirname, 'fixtures', d);
- if (fs.existsSync(p)) { fs.unlinkSync(p); }
- });
- done();
-}
-
-exports.safewrite = {
- setUp: function(done) {
- process.chdir(path.resolve(__dirname, 'fixtures'));
- cleanUp(done);
- },
- tearDown: cleanUp,
- safewrite: function(test) {
- test.expect(4);
-
- var times = 0;
- var file = path.resolve(__dirname, 'fixtures', 'safewrite.js');
- var backup = path.resolve(__dirname, 'fixtures', 'safewrite.ext~');
- fs.writeFileSync(file, 'var safe = true;');
-
- function simSafewrite() {
- fs.writeFileSync(backup, fs.readFileSync(file));
- fs.unlinkSync(file);
- fs.renameSync(backup, file);
- times++;
- }
-
- gaze('**/*', function() {
- this.on('all', function(action, filepath) {
- test.equal(action, 'changed');
- test.equal(path.basename(filepath), 'safewrite.js');
-
- if (times < 2) {
- setTimeout(simSafewrite, 1000);
- } else {
- this.close();
- test.done();
- }
- });
-
- setTimeout(function() {
- simSafewrite();
- }, 1000);
-
- });
- }
-};
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/gaze/test/watch_test.js
----------------------------------------------------------------------
diff --git a/node_modules/gaze/test/watch_test.js b/node_modules/gaze/test/watch_test.js
deleted file mode 100644
index 9d58521..0000000
--- a/node_modules/gaze/test/watch_test.js
+++ /dev/null
@@ -1,207 +0,0 @@
-'use strict';
-
-var gaze = require('../lib/gaze.js');
-var grunt = require('grunt');
-var path = require('path');
-var fs = require('fs');
-
-// Node v0.6 compat
-fs.existsSync = fs.existsSync || path.existsSync;
-
-// Clean up helper to call in setUp and tearDown
-function cleanUp(done) {
- [
- 'sub/tmp.js',
- 'sub/tmp',
- 'sub/renamed.js',
- 'added.js',
- 'nested/added.js',
- 'nested/.tmp',
- 'nested/sub/added.js'
- ].forEach(function(d) {
- var p = path.resolve(__dirname, 'fixtures', d);
- if (fs.existsSync(p)) { fs.unlinkSync(p); }
- });
- done();
-}
-
-exports.watch = {
- setUp: function(done) {
- process.chdir(path.resolve(__dirname, 'fixtures'));
- cleanUp(done);
- },
- tearDown: cleanUp,
- remove: function(test) {
- test.expect(2);
- gaze('**/*', function() {
- this.remove(path.resolve(__dirname, 'fixtures', 'sub', 'two.js'));
- this.remove(path.resolve(__dirname, 'fixtures'));
- var result = this.relative(null, true);
- test.deepEqual(result['sub/'], ['one.js']);
- test.notDeepEqual(result['.'], ['one.js']);
- this.close();
- test.done();
- });
- },
- changed: function(test) {
- test.expect(1);
- gaze('**/*', function(err, watcher) {
- watcher.on('changed', function(filepath) {
- var expected = path.relative(process.cwd(), filepath);
- test.equal(path.join('sub', 'one.js'), expected);
- watcher.close();
- });
- this.on('added', function() { test.ok(false, 'added event should not have emitted.'); });
- this.on('deleted', function() { test.ok(false, 'deleted event should not have emitted.'); });
- fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'one.js'), 'var one = true;');
- watcher.on('end', test.done);
- });
- },
- added: function(test) {
- test.expect(1);
- gaze('**/*', function(err, watcher) {
- watcher.on('added', function(filepath) {
- var expected = path.relative(process.cwd(), filepath);
- test.equal(path.join('sub', 'tmp.js'), expected);
- watcher.close();
- });
- this.on('changed', function() { test.ok(false, 'changed event should not have emitted.'); });
- this.on('deleted', function() { test.ok(false, 'deleted event should not have emitted.'); });
- fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'tmp.js'), 'var tmp = true;');
- watcher.on('end', test.done);
- });
- },
- dontAddUnmatchedFiles: function(test) {
- test.expect(2);
- gaze('**/*.js', function(err, watcher) {
- setTimeout(function() {
- test.ok(true, 'Ended without adding a file.');
- watcher.close();
- }, 1000);
- this.on('added', function(filepath) {
- test.equal(path.relative(process.cwd(), filepath), path.join('sub', 'tmp.js'));
- });
- fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'tmp'), 'Dont add me!');
- fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'tmp.js'), 'add me!');
- watcher.on('end', test.done);
- });
- },
- dontAddMatchedDirectoriesThatArentReallyAdded: function(test) {
- // This is a regression test for a bug I ran into where a matching directory would be reported
- // added when a non-matching file was created along side it. This only happens if the
- // directory name doesn't occur in $PWD.
- test.expect(1);
- gaze('**/*', function(err, watcher) {
- setTimeout(function() {
- test.ok(true, 'Ended without adding a file.');
- watcher.close();
- }, 1000);
- this.on('added', function(filepath) {
- test.notEqual(path.relative(process.cwd(), filepath), path.join('nested', 'sub2'));
- });
- fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'nested', '.tmp'), 'Wake up!');
- watcher.on('end', test.done);
- });
- },
- deleted: function(test) {
- test.expect(1);
- var tmpfile = path.resolve(__dirname, 'fixtures', 'sub', 'deleted.js');
- fs.writeFileSync(tmpfile, 'var tmp = true;');
- gaze('**/*', function(err, watcher) {
- watcher.on('deleted', function(filepath) {
- test.equal(path.join('sub', 'deleted.js'), path.relative(process.cwd(), filepath));
- watcher.close();
- });
- this.on('changed', function() { test.ok(false, 'changed event should not have emitted.'); });
- this.on('added', function() { test.ok(false, 'added event should not have emitted.'); });
- fs.unlinkSync(tmpfile);
- watcher.on('end', test.done);
- });
- },
- dontEmitTwice: function(test) {
- test.expect(2);
- gaze('**/*', function(err, watcher) {
- watcher.on('all', function(status, filepath) {
- var expected = path.relative(process.cwd(), filepath);
- test.equal(path.join('sub', 'one.js'), expected);
- test.equal(status, 'changed');
- fs.readFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'one.js'));
- setTimeout(function() {
- fs.readFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'one.js'));
- }, 1000);
- // Give some time to accidentally emit before we close
- setTimeout(function() { watcher.close(); }, 5000);
- });
- setTimeout(function() {
- fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'one.js'), 'var one = true;');
- }, 1000);
- watcher.on('end', test.done);
- });
- },
- emitTwice: function(test) {
- test.expect(2);
- var times = 0;
- gaze('**/*', function(err, watcher) {
- watcher.on('all', function(status, filepath) {
- test.equal(status, 'changed');
- times++;
- setTimeout(function() {
- if (times < 2) {
- fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'one.js'), 'var one = true;');
- } else {
- watcher.close();
- }
- }, 1000);
- });
- setTimeout(function() {
- fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'one.js'), 'var one = true;');
- }, 1000);
- watcher.on('end', test.done);
- });
- },
- nonExistent: function(test) {
- test.expect(1);
- gaze('non/existent/**/*', function(err, watcher) {
- test.ok(true);
- test.done();
- });
- },
- differentCWD: function(test) {
- test.expect(1);
- var cwd = path.resolve(__dirname, 'fixtures', 'sub');
- gaze('two.js', {
- cwd: cwd
- }, function(err, watcher) {
- watcher.on('changed', function(filepath) {
- test.deepEqual(this.relative(), {'.':['two.js']});
- watcher.close();
- });
- fs.writeFileSync(path.resolve(cwd, 'two.js'), 'var two = true;');
- watcher.on('end', test.done);
- });
- },
- addedEmitInSubFolders: function(test) {
- test.expect(4);
- var adds = [
- { pattern: '**/*', file: path.resolve(__dirname, 'fixtures', 'nested', 'sub', 'added.js') },
- { pattern: '**/*', file: path.resolve(__dirname, 'fixtures', 'added.js') },
- { pattern: 'nested/**/*', file: path.resolve(__dirname, 'fixtures', 'nested', 'added.js') },
- { pattern: 'nested/sub/*.js', file: path.resolve(__dirname, 'fixtures', 'nested', 'sub', 'added.js') },
- ];
- grunt.util.async.forEachSeries(adds, function(add, next) {
- new gaze.Gaze(add.pattern, function(err, watcher) {
- watcher.on('added', function(filepath) {
- test.equal('added.js', path.basename(filepath));
- fs.unlinkSync(filepath);
- watcher.close();
- next();
- });
- watcher.on('changed', function() { test.ok(false, 'changed event should not have emitted.'); });
- watcher.on('deleted', function() { test.ok(false, 'deleted event should not have emitted.'); });
- fs.writeFileSync(add.file, 'var added = true;');
- });
- }, function() {
- test.done();
- });
- },
-};
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/glob/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/glob/.npmignore b/node_modules/glob/.npmignore
deleted file mode 100644
index 2af4b71..0000000
--- a/node_modules/glob/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp
-test/a/
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/glob/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/glob/.travis.yml b/node_modules/glob/.travis.yml
deleted file mode 100644
index baa0031..0000000
--- a/node_modules/glob/.travis.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-language: node_js
-node_js:
- - 0.8
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/glob/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/glob/LICENSE b/node_modules/glob/LICENSE
deleted file mode 100644
index 0c44ae7..0000000
--- a/node_modules/glob/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) Isaac Z. Schlueter ("Author")
-All rights reserved.
-
-The BSD License
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/glob/README.md
----------------------------------------------------------------------
diff --git a/node_modules/glob/README.md b/node_modules/glob/README.md
deleted file mode 100644
index cc69164..0000000
--- a/node_modules/glob/README.md
+++ /dev/null
@@ -1,250 +0,0 @@
-# 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<String>} filenames found matching the pattern
-
-Perform an asynchronous glob search.
-
-## glob.sync(pattern, [options])
-
-* `pattern` {String} Pattern to be matched
-* `options` {Object}
-* return: {Array<String>} 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<String>} 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.
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/glob/examples/g.js
----------------------------------------------------------------------
diff --git a/node_modules/glob/examples/g.js b/node_modules/glob/examples/g.js
deleted file mode 100644
index be122df..0000000
--- a/node_modules/glob/examples/g.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var 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")
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/glob/examples/usr-local.js
----------------------------------------------------------------------
diff --git a/node_modules/glob/examples/usr-local.js b/node_modules/glob/examples/usr-local.js
deleted file mode 100644
index 327a425..0000000
--- a/node_modules/glob/examples/usr-local.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var 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")
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/glob/glob.js
----------------------------------------------------------------------
diff --git a/node_modules/glob/glob.js b/node_modules/glob/glob.js
deleted file mode 100644
index f646c44..0000000
--- a/node_modules/glob/glob.js
+++ /dev/null
@@ -1,728 +0,0 @@
-// 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 = require("fs")
-, minimatch = require("minimatch")
-, Minimatch = minimatch.Minimatch
-, inherits = require("inherits")
-, EE = require("events").EventEmitter
-, path = require("path")
-, isDir = {}
-, assert = require("assert").ok
-
-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") {
- 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 (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 {<filename>: 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)
-
- 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)
- }
-
- 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()
- }
- }
- done = true
-}
-
-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 = path.join("/", prefix)
- }
- read = prefix = path.resolve(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 rawGlob = pattern[n]._glob
- , dotOk = this.dot || rawGlob.charAt(0) === "."
-
- entries = entries.filter(function (e) {
- return (e.charAt(0) !== "." || dotOk) &&
- e.match(pattern[n])
- })
-
- // 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 === ""
-}
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/glob/node_modules/minimatch/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/glob/node_modules/minimatch/.npmignore b/node_modules/glob/node_modules/minimatch/.npmignore
deleted file mode 100644
index 3c3629e..0000000
--- a/node_modules/glob/node_modules/minimatch/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
http://git-wip-us.apache.org/repos/asf/cordova-create/blob/9fb2883e/node_modules/glob/node_modules/minimatch/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/glob/node_modules/minimatch/LICENSE b/node_modules/glob/node_modules/minimatch/LICENSE
deleted file mode 100644
index 05a4010..0000000
--- a/node_modules/glob/node_modules/minimatch/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org