forked from enviPath/enviPy
Current Dev State
This commit is contained in:
7
static/js/ketcher2/node_modules/gulp-tap/LICENSE
generated
vendored
Normal file
7
static/js/ketcher2/node_modules/gulp-tap/LICENSE
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
Copyright 2014 Mario Gutierrez
|
||||
|
||||
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.
|
||||
2
static/js/ketcher2/node_modules/gulp-tap/Makefile
generated
vendored
Normal file
2
static/js/ketcher2/node_modules/gulp-tap/Makefile
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
lib/tap.js lib/tap.js.map: src/tap.coffee
|
||||
@npm run coffee -- --compile --bare --map --output lib src
|
||||
42
static/js/ketcher2/node_modules/gulp-tap/README.md
generated
vendored
Normal file
42
static/js/ketcher2/node_modules/gulp-tap/README.md
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
# gulp-tap [](https://travis-ci.org/geejs/gulp-tap) [](https://coveralls.io/github/geejs/gulp-tap?branch=master) [](https://david-dm.org/geejs/gulp-tap)
|
||||
|
||||
Easily tap into a pipeline.
|
||||
|
||||
## Uses
|
||||
|
||||
Some filters like `gulp-coffee` process all files. What if you want to process
|
||||
all JS and Coffee files in a single pipeline. Use `tap` to filter out `.coffee`
|
||||
files and process them through the `coffee` filter and let JavaScript files
|
||||
pass through.
|
||||
|
||||
```js
|
||||
gulp.src("src/**/*.{coffee,js}")
|
||||
.pipe(tap(function(file, t) {
|
||||
if (path.extname(file.path) === '.coffee') {
|
||||
return t.through(coffee, []);
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest('build'));
|
||||
```
|
||||
|
||||
What if you want to change content like add a header? No need for a separate
|
||||
filter, just change the content.
|
||||
|
||||
```js
|
||||
tap(function(file) {
|
||||
file.contents = Buffer.concat([
|
||||
new Buffer('HEADER'),
|
||||
file.contents
|
||||
]);
|
||||
});
|
||||
```
|
||||
|
||||
If you do not return a stream, tap forwards your changes.
|
||||
|
||||
## Examples
|
||||
|
||||
See [Wiki](https://github.com/geejs/gulp-tap/wiki) for more examples.
|
||||
|
||||
## License
|
||||
|
||||
The MIT License (MIT)
|
||||
1
static/js/ketcher2/node_modules/gulp-tap/index.js
generated
vendored
Normal file
1
static/js/ketcher2/node_modules/gulp-tap/index.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./lib/tap.js');
|
||||
76
static/js/ketcher2/node_modules/gulp-tap/lib/tap.js
generated
vendored
Normal file
76
static/js/ketcher2/node_modules/gulp-tap/lib/tap.js
generated
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
'use strict';
|
||||
var DEBUG, baseStream, through;
|
||||
|
||||
baseStream = require('stream');
|
||||
|
||||
through = require('through2');
|
||||
|
||||
DEBUG = process.env.NODE_ENV === 'development';
|
||||
|
||||
|
||||
/*
|
||||
* Taps into the pipeline and allows user to easily route data through
|
||||
* another stream or change content.
|
||||
*/
|
||||
|
||||
module.exports = function(lambda) {
|
||||
var modifyFile, utils;
|
||||
utils = function(tapStream, file) {
|
||||
return {
|
||||
|
||||
/*
|
||||
* Routes through another stream. The filter must not be
|
||||
* created. This will create the filter as needed.
|
||||
*
|
||||
* @param filter {stream}
|
||||
* @param args {Array} Array containg arguments to apply to filter.
|
||||
*
|
||||
* @example
|
||||
* t.through coffee, [{bare: true}]
|
||||
*/
|
||||
through: function(filter, args) {
|
||||
var stream;
|
||||
if (DEBUG) {
|
||||
if (!Array.isArray(args)) {
|
||||
throw new TypeError("Args must be an array to `apply` to the filter");
|
||||
}
|
||||
}
|
||||
stream = filter.apply(null, args);
|
||||
stream.on("error", function(err) {
|
||||
return tapStream.emit("error", err);
|
||||
});
|
||||
stream.write(file);
|
||||
return stream;
|
||||
}
|
||||
};
|
||||
};
|
||||
modifyFile = function(file, enc, cb) {
|
||||
var data, inst, next, obj;
|
||||
inst = {
|
||||
file: file
|
||||
};
|
||||
obj = lambda(inst.file, utils(this, inst.file), inst);
|
||||
next = (function(_this) {
|
||||
return function() {
|
||||
_this.push(file);
|
||||
return cb();
|
||||
};
|
||||
})(this);
|
||||
if (obj instanceof baseStream && !obj._readableState.ended) {
|
||||
obj.on('end', next);
|
||||
return obj.on('data', data = function() {
|
||||
obj.removeListener('end', next);
|
||||
obj.removeListener('data', data);
|
||||
return next();
|
||||
});
|
||||
} else {
|
||||
return next();
|
||||
}
|
||||
};
|
||||
return through.obj(modifyFile, function(cb) {
|
||||
return cb();
|
||||
});
|
||||
};
|
||||
|
||||
//# sourceMappingURL=tap.js.map
|
||||
10
static/js/ketcher2/node_modules/gulp-tap/lib/tap.js.map
generated
vendored
Normal file
10
static/js/ketcher2/node_modules/gulp-tap/lib/tap.js.map
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"version": 3,
|
||||
"file": "tap.js",
|
||||
"sourceRoot": "..",
|
||||
"sources": [
|
||||
"src/tap.coffee"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": ";AAAA;AAAA,IAAA;;AAEA,UAAA,GAAa,OAAA,CAAQ,QAAR;;AACb,OAAA,GAAU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AA1B;QACA,GAAG,CAAC,cAAJ,CAAmB,MAAnB,EAA2B,IAA3B;eACA,IAAA,CAAA;MAHoB,CAAtB,EAHF;KAAA,MAAA;aAQE,IAAA,CAAA,EARF;;EAVW;AAoBb,SAAO,OAAO,CAAC,GAAR,CAAY,UAAZ,EAAwB,SAAC,EAAD;WAAQ,EAAA,CAAA;EAAR,CAAxB;AAjDQ"
|
||||
}
|
||||
67
static/js/ketcher2/node_modules/gulp-tap/package.json
generated
vendored
Normal file
67
static/js/ketcher2/node_modules/gulp-tap/package.json
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
{
|
||||
"_from": "gulp-tap@1.0.1",
|
||||
"_id": "gulp-tap@1.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-5nESThJZtM6iGe0cqXt/WFwzRpA=",
|
||||
"_location": "/gulp-tap",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "gulp-tap@1.0.1",
|
||||
"name": "gulp-tap",
|
||||
"escapedName": "gulp-tap",
|
||||
"rawSpec": "1.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/gulp-tap/-/gulp-tap-1.0.1.tgz",
|
||||
"_shasum": "e671124e1259b4cea219ed1ca97b7f585c334690",
|
||||
"_spec": "gulp-tap@1.0.1",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher",
|
||||
"authors": [
|
||||
"Mario Gutierrez <mario@mgutz.com>",
|
||||
"Jon Ege Ronnenberg <jon.ronnenberg@gmail.com>",
|
||||
"Javey <jiawei23716@sina.com>"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/geejs/gulp-tap/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"through2": "^2.0.3"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Easiest way to tap into a pipeline",
|
||||
"devDependencies": {
|
||||
"coffee-script": "^1.12.4",
|
||||
"coveralls": "^2.13.0",
|
||||
"gulp": "^3.9.1",
|
||||
"tap": "^10.3.1"
|
||||
},
|
||||
"homepage": "https://github.com/geejs/gulp-tap",
|
||||
"keywords": [
|
||||
"tap",
|
||||
"gulp",
|
||||
"stream"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "gulp-tap",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/geejs/gulp-tap.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coffee": "coffee",
|
||||
"dev": "coffee --watch --compile tests & coffee --watch --compile src",
|
||||
"posttest": "rm tests/*.js tests/*.js.map",
|
||||
"pretest": "coffee --compile --map tests",
|
||||
"test": "tap -J tests/*.js",
|
||||
"test:cov": "npm test -- --cov"
|
||||
},
|
||||
"version": "1.0.1"
|
||||
}
|
||||
62
static/js/ketcher2/node_modules/gulp-tap/src/tap.coffee
generated
vendored
Normal file
62
static/js/ketcher2/node_modules/gulp-tap/src/tap.coffee
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
'use strict'
|
||||
|
||||
baseStream = require('stream')
|
||||
through = require('through2')
|
||||
|
||||
DEBUG = process.env.NODE_ENV is 'development'
|
||||
|
||||
|
||||
###
|
||||
# Taps into the pipeline and allows user to easily route data through
|
||||
# another stream or change content.
|
||||
###
|
||||
module.exports = (lambda) ->
|
||||
utils = (tapStream, file) ->
|
||||
|
||||
###
|
||||
# Routes through another stream. The filter must not be
|
||||
# created. This will create the filter as needed.
|
||||
#
|
||||
# @param filter {stream}
|
||||
# @param args {Array} Array containg arguments to apply to filter.
|
||||
#
|
||||
# @example
|
||||
# t.through coffee, [{bare: true}]
|
||||
###
|
||||
through: (filter, args) ->
|
||||
|
||||
if DEBUG
|
||||
if not Array.isArray(args)
|
||||
throw new TypeError("Args must be an array to `apply` to the filter")
|
||||
|
||||
stream = filter.apply(null, args)
|
||||
stream.on "error", (err) ->
|
||||
tapStream.emit "error", err
|
||||
|
||||
# Use original stream pipe file when emit `end/data` event
|
||||
# stream.pipe tapStream
|
||||
|
||||
stream.write file
|
||||
stream
|
||||
|
||||
modifyFile = (file, enc, cb) ->
|
||||
inst = file: file
|
||||
obj = lambda(inst.file, utils(this, inst.file), inst)
|
||||
|
||||
next = () =>
|
||||
this.push(file)
|
||||
cb()
|
||||
|
||||
# if user returned a stream
|
||||
# passthrough when the stream is ended
|
||||
if obj instanceof baseStream and not obj._readableState.ended
|
||||
|
||||
obj.on('end', next)
|
||||
obj.on('data', data = ->
|
||||
obj.removeListener 'end', next
|
||||
obj.removeListener 'data', data
|
||||
next())
|
||||
else
|
||||
next()
|
||||
|
||||
return through.obj(modifyFile, (cb) -> cb())
|
||||
26
static/js/ketcher2/node_modules/gulp-tap/tests/base.test.coffee
generated
vendored
Normal file
26
static/js/ketcher2/node_modules/gulp-tap/tests/base.test.coffee
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
fs = require 'fs'
|
||||
path = require 'path'
|
||||
gulp = require 'gulp'
|
||||
tap = require '../'
|
||||
tapTest = require 'tap'
|
||||
|
||||
|
||||
# helper function to get a path relative to the root
|
||||
getPath = (rel) -> path.resolve __dirname, '..', rel
|
||||
|
||||
|
||||
tapTest.test "change file.base twice will end with 'Error: no writecb in Transform classh' #5", (test) ->
|
||||
|
||||
test.plan 1
|
||||
|
||||
fixturePath = getPath 'tests/fixtures/'
|
||||
|
||||
gulp.src fixturePath + '/js.js'
|
||||
.pipe tap (file) ->
|
||||
file.old_base = file.base
|
||||
file.base += 'random-path/'
|
||||
.pipe tap (file) ->
|
||||
file.base = file.old_base
|
||||
.pipe tap (file) ->
|
||||
test.ok true
|
||||
test.end()
|
||||
84
static/js/ketcher2/node_modules/gulp-tap/tests/dest.test.coffee
generated
vendored
Normal file
84
static/js/ketcher2/node_modules/gulp-tap/tests/dest.test.coffee
generated
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
fs = require 'fs'
|
||||
path = require 'path'
|
||||
gulp = require 'gulp'
|
||||
tap = require '../'
|
||||
tapTest = require 'tap'
|
||||
|
||||
deleteDirectory = (p) ->
|
||||
if fs.existsSync p
|
||||
fs.readdirSync(p).forEach (file) ->
|
||||
curP = (p + '/' + file)
|
||||
if fs.lstatSync(curP).isDirectory()
|
||||
deleteDirectory curP
|
||||
else
|
||||
fs.unlinkSync curP
|
||||
fs.rmdirSync p
|
||||
|
||||
clean = ->
|
||||
deleteDirectory 'assets'
|
||||
deleteDirectory 'scripts'
|
||||
deleteDirectory 'sass'
|
||||
|
||||
# helper function to get a path relative to the root
|
||||
getPath = (rel) -> path.resolve __dirname, '..', rel
|
||||
|
||||
|
||||
tapTest.test "gulp-tap can change dest in the middle of stream", (test) ->
|
||||
|
||||
test.tearDown(clean)
|
||||
|
||||
test.plan 3
|
||||
|
||||
destinations =
|
||||
'scss': 'sass'
|
||||
'js': 'scripts'
|
||||
'img': 'assets/images'
|
||||
|
||||
fixturePath = getPath 'tests/fixtures/'
|
||||
|
||||
where = (file, t) ->
|
||||
match = (p) ->
|
||||
ext = (path.extname p)
|
||||
.substr 1 # remove leading '.'
|
||||
if( ext in ['jpg', 'png', 'svg', 'gif'] )
|
||||
ext = 'img'
|
||||
destinations[ext] or false
|
||||
|
||||
# for debugging
|
||||
# console.log 'destPath', destPath, file.path
|
||||
destPath = match file.path
|
||||
|
||||
if destPath
|
||||
t.through gulp.dest, [destPath]
|
||||
|
||||
|
||||
fs.readdir fixturePath, (err, files) ->
|
||||
if err
|
||||
console.trace('Can not read fixtures from ' + fixturePath)
|
||||
test.end()
|
||||
|
||||
gulp.src files.map (p) -> (fixturePath + '/' + p)
|
||||
.pipe tap where
|
||||
.on 'end', ->
|
||||
setTimeout (->
|
||||
test.ok fs.existsSync getPath 'assets/images/img.png'
|
||||
test.ok fs.existsSync getPath 'scripts/js.js'
|
||||
test.ok fs.existsSync getPath 'sass/s.scss'
|
||||
test.end()
|
||||
), 500 # give gulp.dest a (500ms) chance to write the files
|
||||
.on 'error', (err) ->
|
||||
console.trace(err)
|
||||
test.end()
|
||||
.pipe tap(->) # We must provide a pipe to make stream end
|
||||
|
||||
|
||||
### stub for https://github.com/geejs/gulp-tap/issues/3
|
||||
exports.sameIOFileName =
|
||||
|
||||
'test for infinite loop, issue #3': (test) ->
|
||||
test.plan 1
|
||||
|
||||
fixturePath = getPath 'tests/fixtures/'
|
||||
gulp.src fixturePath + '/*'
|
||||
test.ok true
|
||||
test.end()###
|
||||
1
static/js/ketcher2/node_modules/gulp-tap/tests/fixtures/img.png
generated
vendored
Normal file
1
static/js/ketcher2/node_modules/gulp-tap/tests/fixtures/img.png
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
I'm an image file
|
||||
1
static/js/ketcher2/node_modules/gulp-tap/tests/fixtures/js.js
generated
vendored
Normal file
1
static/js/ketcher2/node_modules/gulp-tap/tests/fixtures/js.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
I'm a javascript file
|
||||
1
static/js/ketcher2/node_modules/gulp-tap/tests/fixtures/s.scss
generated
vendored
Normal file
1
static/js/ketcher2/node_modules/gulp-tap/tests/fixtures/s.scss
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
I'm a SASS file
|
||||
35
static/js/ketcher2/node_modules/gulp-tap/tests/throws.test.coffee
generated
vendored
Normal file
35
static/js/ketcher2/node_modules/gulp-tap/tests/throws.test.coffee
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
process.env['NODE_ENV'] = 'development'
|
||||
|
||||
fs = require 'fs'
|
||||
path = require 'path'
|
||||
gulp = require 'gulp'
|
||||
tap = require '../'
|
||||
tapTest = require 'tap'
|
||||
|
||||
|
||||
# helper function to get a path relative to the root
|
||||
getPath = (rel) -> path.resolve __dirname, '..', rel
|
||||
|
||||
identity = (x) -> x
|
||||
|
||||
|
||||
tapTest.test "throw errors", (test) ->
|
||||
|
||||
test.plan 2
|
||||
|
||||
gulp.src getPath 'tests/fixtures/' + 'js.js'
|
||||
.pipe tap (file, t) ->
|
||||
test.throws t.through.bind(null, gulp.dest, "wrong"), new TypeError("Args must be an array to `apply` to the filter")
|
||||
|
||||
gulp.src getPath 'tests/fixtures/' + 'js.js'
|
||||
.pipe tap (file, t) ->
|
||||
test.throws t.through.bind(null, identity, ["right"]), {}, "should throw if supplied function doesn't return a stream'"
|
||||
|
||||
### Giving up due to lack of knowledge about vinyl-fs streams - I don't know how to get them to emit an error
|
||||
tapTest.test "emit errors from stream errors", (test) ->
|
||||
|
||||
test.plan 1
|
||||
|
||||
gulp.src getPath 'tests/fixtures/' + 'js.js'
|
||||
.pipe tap (file, t) ->
|
||||
test.doesNotThrow t.through.bind(null, gulp.src, ['non-existing.txt'])###
|
||||
Reference in New Issue
Block a user