diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-10-10 03:43:44 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-10-10 03:43:44 +0200 |
commit | abd94a7f5a50f43c797a11b53549ae48fff667c3 (patch) | |
tree | ab8ed457f65cdd72e13e0571d2975729428f1551 /node_modules/glob-watcher | |
parent | a0247c6a3fd6a09a41a7e35a3441324c4dcb58be (diff) | |
download | wallet-core-abd94a7f5a50f43c797a11b53549ae48fff667c3.tar.xz |
add node_modules to address #4364
Diffstat (limited to 'node_modules/glob-watcher')
-rw-r--r-- | node_modules/glob-watcher/.npmignore | 6 | ||||
-rw-r--r-- | node_modules/glob-watcher/.travis.yml | 6 | ||||
-rwxr-xr-x | node_modules/glob-watcher/LICENSE | 20 | ||||
-rw-r--r-- | node_modules/glob-watcher/README.md | 53 | ||||
-rw-r--r-- | node_modules/glob-watcher/index.js | 39 | ||||
-rw-r--r-- | node_modules/glob-watcher/package.json | 99 | ||||
-rw-r--r-- | node_modules/glob-watcher/test/fixtures/test.coffee | 1 | ||||
-rw-r--r-- | node_modules/glob-watcher/test/main.js | 87 |
8 files changed, 311 insertions, 0 deletions
diff --git a/node_modules/glob-watcher/.npmignore b/node_modules/glob-watcher/.npmignore new file mode 100644 index 000000000..b5ef13a3c --- /dev/null +++ b/node_modules/glob-watcher/.npmignore @@ -0,0 +1,6 @@ +.DS_Store +*.log +node_modules +build +*.node +components
\ No newline at end of file diff --git a/node_modules/glob-watcher/.travis.yml b/node_modules/glob-watcher/.travis.yml new file mode 100644 index 000000000..33ad9f8c8 --- /dev/null +++ b/node_modules/glob-watcher/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "0.9" + - "0.10" +after_script: + - npm run coveralls
\ No newline at end of file diff --git a/node_modules/glob-watcher/LICENSE b/node_modules/glob-watcher/LICENSE new file mode 100755 index 000000000..4f482f9ba --- /dev/null +++ b/node_modules/glob-watcher/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2013 Fractal <contact@wearefractal.com> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/glob-watcher/README.md b/node_modules/glob-watcher/README.md new file mode 100644 index 000000000..129311ebc --- /dev/null +++ b/node_modules/glob-watcher/README.md @@ -0,0 +1,53 @@ +# glob-watcher [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Dependency Status][david-image]][david-url] + +## Information + +<table> +<tr> +<td>Package</td><td>glob-watcher</td> +</tr> +<tr> +<td>Description</td> +<td>Watch globs</td> +</tr> +<tr> +<td>Node Version</td> +<td>>= 0.9</td> +</tr> +</table> + +## Usage + +```javascript +var watch = require('glob-watcher'); + +// callback interface +watch(["./*.js", "!./something.js"], function(evt){ + // evt has what file changed and all that jazz +}); + +// EE interface +var watcher = watch(["./*.js", "!./something.js"]); +watcher.on('change', function(evt) { + // evt has what file changed and all that jazz +}); + +// add files after it has been created +watcher.add("./somefolder/somefile.js"); +``` + + +[npm-url]: https://npmjs.org/package/glob-watcher +[npm-image]: https://badge.fury.io/js/glob-watcher.png + +[travis-url]: https://travis-ci.org/wearefractal/glob-watcher +[travis-image]: https://travis-ci.org/wearefractal/glob-watcher.png?branch=master + +[coveralls-url]: https://coveralls.io/r/wearefractal/glob-watcher +[coveralls-image]: https://coveralls.io/repos/wearefractal/glob-watcher/badge.png + +[depstat-url]: https://david-dm.org/wearefractal/glob-watcher +[depstat-image]: https://david-dm.org/wearefractal/glob-watcher.png + +[david-url]: https://david-dm.org/wearefractal/glob-watcher +[david-image]: https://david-dm.org/wearefractal/glob-watcher.png?theme=shields.io diff --git a/node_modules/glob-watcher/index.js b/node_modules/glob-watcher/index.js new file mode 100644 index 000000000..907defd4e --- /dev/null +++ b/node_modules/glob-watcher/index.js @@ -0,0 +1,39 @@ +var gaze = require('gaze'); +var EventEmitter = require('events').EventEmitter; + +module.exports = function(glob, opts, cb) { + var out = new EventEmitter(); + + if (typeof opts === 'function') { + cb = opts; + opts = {}; + } + + var watcher = gaze(glob, opts, function(err, rwatcher){ + if (err) out.emit('error', err); + rwatcher.on('all', function(evt, path, old){ + var outEvt = {type: evt, path: path}; + if(old) outEvt.old = old; + out.emit('change', outEvt); + if(cb) cb(outEvt); + }); + }); + + watcher.on('end', out.emit.bind(out, 'end')); + watcher.on('error', out.emit.bind(out, 'error')); + watcher.on('ready', out.emit.bind(out, 'ready')); + watcher.on('nomatch', out.emit.bind(out, 'nomatch')); + + out.end = function(){ + return watcher.close(); + }; + out.add = function(){ + return watcher.add.apply(watcher, arguments); + }; + out.remove = function(){ + return watcher.remove(); + }; + out._watcher = watcher; + + return out; +}; diff --git a/node_modules/glob-watcher/package.json b/node_modules/glob-watcher/package.json new file mode 100644 index 000000000..8016d9186 --- /dev/null +++ b/node_modules/glob-watcher/package.json @@ -0,0 +1,99 @@ +{ + "_args": [ + [ + { + "raw": "glob-watcher@^0.0.6", + "scope": null, + "escapedName": "glob-watcher", + "name": "glob-watcher", + "rawSpec": "^0.0.6", + "spec": ">=0.0.6 <0.0.7", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp/node_modules/vinyl-fs" + ] + ], + "_from": "glob-watcher@>=0.0.6 <0.0.7", + "_id": "glob-watcher@0.0.6", + "_inCache": true, + "_location": "/glob-watcher", + "_npmUser": { + "name": "fractal", + "email": "contact@wearefractal.com" + }, + "_npmVersion": "1.4.7", + "_phantomChildren": {}, + "_requested": { + "raw": "glob-watcher@^0.0.6", + "scope": null, + "escapedName": "glob-watcher", + "name": "glob-watcher", + "rawSpec": "^0.0.6", + "spec": ">=0.0.6 <0.0.7", + "type": "range" + }, + "_requiredBy": [ + "/gulp/vinyl-fs" + ], + "_resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz", + "_shasum": "b95b4a8df74b39c83298b0c05c978b4d9a3b710b", + "_shrinkwrap": null, + "_spec": "glob-watcher@^0.0.6", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp/node_modules/vinyl-fs", + "author": { + "name": "Fractal", + "email": "contact@wearefractal.com", + "url": "http://wearefractal.com/" + }, + "bugs": { + "url": "https://github.com/wearefractal/glob-watcher/issues" + }, + "dependencies": { + "gaze": "^0.5.1" + }, + "description": "Watch globs", + "devDependencies": { + "coveralls": "^2.6.1", + "istanbul": "^0.2.3", + "jshint": "^2.4.1", + "mkdirp": "^0.3.5", + "mocha": "^1.17.0", + "mocha-lcov-reporter": "0.0.1", + "rimraf": "^2.2.5", + "should": "^2.1.1" + }, + "directories": {}, + "dist": { + "shasum": "b95b4a8df74b39c83298b0c05c978b4d9a3b710b", + "tarball": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz" + }, + "engines": { + "node": ">= 0.9" + }, + "homepage": "http://github.com/wearefractal/glob-watcher", + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/wearefractal/glob-watcher/raw/master/LICENSE" + } + ], + "main": "./index.js", + "maintainers": [ + { + "name": "fractal", + "email": "contact@wearefractal.com" + } + ], + "name": "glob-watcher", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/wearefractal/glob-watcher.git" + }, + "scripts": { + "coveralls": "istanbul cover _mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage", + "test": "mocha --reporter spec && jshint" + }, + "version": "0.0.6" +} diff --git a/node_modules/glob-watcher/test/fixtures/test.coffee b/node_modules/glob-watcher/test/fixtures/test.coffee new file mode 100644 index 000000000..4be3c4508 --- /dev/null +++ b/node_modules/glob-watcher/test/fixtures/test.coffee @@ -0,0 +1 @@ +test test
\ No newline at end of file diff --git a/node_modules/glob-watcher/test/main.js b/node_modules/glob-watcher/test/main.js new file mode 100644 index 000000000..2903e8f8a --- /dev/null +++ b/node_modules/glob-watcher/test/main.js @@ -0,0 +1,87 @@ +var watch = require('../'); +var should = require('should'); +var path = require('path'); +var fs = require('fs'); +var rimraf = require('rimraf'); +var mkdirp = require('mkdirp'); + +require('mocha'); + +describe('glob-watcher', function() { + it('should return a valid file struct via EE', function(done) { + var expectedName = path.join(__dirname, "./fixtures/stuff/temp.coffee"); + var fname = path.join(__dirname, "./fixtures/**/temp.coffee"); + mkdirp.sync(path.dirname(expectedName)); + fs.writeFileSync(expectedName, "testing"); + + var watcher = watch(fname); + watcher.on('change', function(evt) { + should.exist(evt); + should.exist(evt.path); + should.exist(evt.type); + evt.type.should.equal('changed'); + evt.path.should.equal(expectedName); + watcher.end(); + }); + watcher.on('end', function(){ + rimraf.sync(expectedName); + done(); + }); + setTimeout(function(){ + fs.writeFileSync(expectedName, "test test"); + }, 125); + }); + + it('should emit nomatch via EE', function(done) { + var fname = path.join(__dirname, "./doesnt_exist_lol/temp.coffee"); + + var watcher = watch(fname); + watcher.on('nomatch', function() { + done(); + }); + }); + + it('should return a valid file struct via callback', function(done) { + var expectedName = path.join(__dirname, "./fixtures/stuff/test.coffee"); + var fname = path.join(__dirname, "./fixtures/**/test.coffee"); + mkdirp.sync(path.dirname(expectedName)); + fs.writeFileSync(expectedName, "testing"); + + var watcher = watch(fname, function(evt) { + should.exist(evt); + should.exist(evt.path); + should.exist(evt.type); + evt.type.should.equal('changed'); + evt.path.should.equal(expectedName); + watcher.end(); + }); + + watcher.on('end', function(){ + rimraf.sync(expectedName); + done(); + }); + setTimeout(function(){ + fs.writeFileSync(expectedName, "test test"); + }, 200); + }); + + it('should not return a non-matching file struct via callback', function(done) { + var expectedName = path.join(__dirname, "./fixtures/test123.coffee"); + var fname = path.join(__dirname, "./fixtures/**/test.coffee"); + mkdirp.sync(path.dirname(expectedName)); + fs.writeFileSync(expectedName, "testing"); + + var watcher = watch(fname, function(evt) { + throw new Error("Should not have been called! "+evt.path); + }); + + setTimeout(function(){ + fs.writeFileSync(expectedName, "test test"); + }, 200); + + setTimeout(function(){ + rimraf.sync(expectedName); + done(); + }, 1500); + }); +});
\ No newline at end of file |