Compare commits

..

21 Commits

Author SHA1 Message Date
c5ec5fc0f9 1.1.0 2016-02-14 18:40:45 +01:00
17aa25fb61 update README 2016-02-14 18:40:37 +01:00
6e55ed3162 now accepts promises as return of supplied functions 2016-02-14 18:36:34 +01:00
ac9305c480 1.0.4 2016-02-12 05:41:06 +01:00
a51419f2b0 add npmts.json 2016-02-12 05:41:02 +01:00
4b02d17d6d 1.0.3 2016-02-12 05:36:31 +01:00
57350d6fee add better tests and coverage 2016-02-12 05:36:23 +01:00
dcdf0059cc 1.0.2 2016-02-02 15:21:45 +01:00
9cc9e15b04 update deps 2016-02-02 15:21:27 +01:00
6a19698617 1.0.1 2016-02-01 03:45:38 +01:00
bc53520869 update travis 2016-02-01 03:45:13 +01:00
752dec8fea update npmts 2016-02-01 03:43:29 +01:00
ffc12d3fd5 1.0.0 2016-02-01 03:40:45 +01:00
0c0f0b78e1 update keywords 2016-02-01 03:40:30 +01:00
3d01801df6 0.0.12 2016-02-01 03:35:23 +01:00
5355fd4e83 update package.json 2016-02-01 03:35:09 +01:00
27a97c1bde cleanup 2016-02-01 03:33:33 +01:00
c1f1500ffc 0.0.10 2015-11-30 09:49:58 +01:00
e42c5004c2 updated structure 2015-11-30 09:49:52 +01:00
e0c4a10411 0.0.9 2015-11-24 13:51:07 +01:00
6deab0541f update deps 2015-11-24 13:49:02 +01:00
23 changed files with 273 additions and 2376 deletions

4
.gitignore vendored
View File

@ -1,6 +1,10 @@
node_modules/ node_modules/
.settings/ .settings/
.idea/ .idea/
coverage/
ts/*.js ts/*.js
ts/*.js.map ts/*.js.map
ts/typings/
test/result/

3
.npmignore Normal file
View File

@ -0,0 +1,3 @@
ts/
test/
node_modules/

View File

@ -1,19 +1,14 @@
language: node_js language: node_js
before_install: node_js:
- nvm install stable - 4.2.4
- node -v
- npm -v
- npm install -g gulp
- npm install gulp
- npm install gulp-typescript
deploy: deploy:
provider: npm provider: npm
email: npm@smart-coordination.com email: npm@lossless.digital
api_key: api_key:
secure: ZgxvXgxlJlDDx4sv2H+M0Z36sZHDKEYRntudQWKLaDt1T2VojfsigNORrDZcHCs6FZo8t2Klsqte8PqDvAn7BxXIo5K86aaZOyulcHnmDQS6rBhJYHm01qJj2B+t03EozcsueYGcQIVyFLBnKl5Yj8GdQ6iVGbimHvgym/Bbo6pKQlKHvv7a+tOSmtRffeG4jZU454MYqc38ZPtKftdknk7m4T0wUP2l9Y1jKva8Zjd4+cw+xOhFAStkySrq8uNBEINN8e5vqvaOxq1d7V8evK7JQLjDtLOaj67cHJ3u7ZjHA2zk1j/Rs7X2jkeqqRbG1zhSHUjjqvnZRzC6ygswOHBBnSzF9P+tN7+jcNcn09PLsKh/HyXq/aRFKsNtvKjUey4cM27yt/LRLis70hrRTgR9EDZ/Q4Aoa/P/ObYf0XDE1rH08nngeASdmGFN+6n6idSq8C7IQ/YfmmQBhIhTSaNSGsYcG827fB5EZLoojCDOuNIrfyMOJHrSy14rgNWiGRj7C0md4yP7qGP53JPU9pPZLzRiD2/y9KuZ4qnE/edj9+POmVCr+uz2ILFQcTkEb9gItfMQGLd5m5MtPHgVFcoslU14O8o5WyFdG80xDHBvyy+1TsqnyRPwwlLwzepqZeUltZKXiOMDRIRurDRC1jtwcf8kJmWboio3GLIdQFU= secure: TWN/oiICeNbAhGTbwf75FnKhXnIvyA66FhNF7C0jpjn2SChSgTANai87r0f9oU9ZP3307XdGHB+fTTCJnk3upNiBoWZnkV8skkAlseOY4mVzF9mS0ZEkxVR32FjJDWfqzv6hC+Y9qNDsGs2+Avsm6fQUOispLXYAk6VzSQC1HgIfyOJtIWT5LqEyXyT6oJIZ7xwt1CYcIeEpHUiAaPYsMEpwF5OBDFByVmNV38VdRGIBsoQd3lixso7/zOOgYvjR4b/onz5WzeWYlhzAuyzOnRGr1r/9eXAzzkYydvgFx3ix5OlrreKVFB6OtMpz4jmHdu9YDGT5bcvL2bSU2SGVQM5Bx8zZXkAxACQR8ZvWmPaWYAWCu9wrW5oovjqFUV0iR26z/sTABJqz4GaXf/vFcll2EdTfUT6xj2kCodfxljaudjPUF27FSt1UJBC7jQky08wHb6+onrE8WoQXteIE2oxtHWEGOlV/GAz0+q4ih0bdOSKfThmux0iEFmeF16sWH9UdL2jBBKuus+fBPdhA3V6uwYQtsCAurhquQLISkf7kT3KujdLS302bEbkut+D1Kd22IYA1J0wYd87th88TZHx7wgQyC+8lVHG+B1R20xGLxyHVEOfyZtChfBRdn53EcUiA2XriJbfiIym4dAMUtOg2iRJamHAL7jebQEUu7oA=
on: on:
tags: true tags: true
repo: pushrocks/gulp-callfunction repo: pushrocks/gulp-function
notifications: notifications:
slack: slack:
secure: Bb8P3fboL52CugSsp0RhOkGCeWVbgjb+QDpnMHdSOa0Nequj8V4kvrzBLZOBOjaSB0/gMvdoB4Slv2bls1dAxXW1IX1DdRb3RLMKj/Owje7eTd4IoUuSs49y6/yEkVK+E1wicdwjlMmvsk8fQE/owDRMRXYoXxhN2ZOVSQvAQ3iBO0eokFvWO7yj/VSxKoITymCXA3LfyzXXUuhvxuQd3BPZCe25xa6GWuHtaa5fbJg17pp8jJX6VZYLSRcSYyJxMU8SLdkrOsQZKj0+/Yfpu7XTmPbqxjNapuE7Zm70mi+aB26IQCnmwkdcEQNJVxQOKoP2+/ZnDfcTLQROwH1PJVzol0hneH6DdOlWt9bvBJcUvFRwaDgIb5xXQV8bGsRe5ayE/4MgCgfvdBTvevu6n12fmPx74prIv4pOPMwlALjjP8XavGL4A6amOuV7fJiSyGAku8aUe1rlUXyfoHJswMyOfkIsvnGDE3eEfq1WUIjn8tW1ZozJyoCTAIh6IHPI3Nsg3LkTRvDHPYq25/xCKWxGb2OaJc3JeqVREqm0auDqj6HoVAi/mW/uyvwX9jEVX8fNoQ69ac5VUMFfn2Mx3sU6aHKgZe/tdrtql6NYtIA+g5/ZDnHE1mnbl6MfrYiKwRbrICH5v/u1xK+4+yh09BUqazi3PzOhyTRfba/gRUg= secure: Bb8P3fboL52CugSsp0RhOkGCeWVbgjb+QDpnMHdSOa0Nequj8V4kvrzBLZOBOjaSB0/gMvdoB4Slv2bls1dAxXW1IX1DdRb3RLMKj/Owje7eTd4IoUuSs49y6/yEkVK+E1wicdwjlMmvsk8fQE/owDRMRXYoXxhN2ZOVSQvAQ3iBO0eokFvWO7yj/VSxKoITymCXA3LfyzXXUuhvxuQd3BPZCe25xa6GWuHtaa5fbJg17pp8jJX6VZYLSRcSYyJxMU8SLdkrOsQZKj0+/Yfpu7XTmPbqxjNapuE7Zm70mi+aB26IQCnmwkdcEQNJVxQOKoP2+/ZnDfcTLQROwH1PJVzol0hneH6DdOlWt9bvBJcUvFRwaDgIb5xXQV8bGsRe5ayE/4MgCgfvdBTvevu6n12fmPx74prIv4pOPMwlALjjP8XavGL4A6amOuV7fJiSyGAku8aUe1rlUXyfoHJswMyOfkIsvnGDE3eEfq1WUIjn8tW1ZozJyoCTAIh6IHPI3Nsg3LkTRvDHPYq25/xCKWxGb2OaJc3JeqVREqm0auDqj6HoVAi/mW/uyvwX9jEVX8fNoQ69ac5VUMFfn2Mx3sU6aHKgZe/tdrtql6NYtIA+g5/ZDnHE1mnbl6MfrYiKwRbrICH5v/u1xK+4+yh09BUqazi3PzOhyTRfba/gRUg=

View File

@ -1,26 +1,38 @@
# gulp-callfunction # gulp-function
accepts call to execute in gulp pipeline. accepts call to execute in gulp pipeline.
### build status/Dependencies ### Status
[![Build Status](https://travis-ci.org/pushrocks/gulp-callfunction.svg?branch=v0.0.2)](https://travis-ci.org/pushrocks/gulp-callfunction) [![Build Status](https://travis-ci.org/pushrocks/gulp-function.svg?branch=v0.0.2)](https://travis-ci.org/pushrocks/gulp-function)
[![Dependency Status](https://david-dm.org/pushrocks/gulp-callfunction.svg)](https://david-dm.org/pushrocks/gulp-callfunction) [![Dependency Status](https://david-dm.org/pushrocks/gulp-function.svg)](https://david-dm.org/pushrocks/gulp-function)
[![devDependency Status](https://david-dm.org/pushrocks/gulp-callfunction/dev-status.svg)](https://david-dm.org/pushrocks/gulp-callfunction#info=devDependencies) [![devDependency Status](https://david-dm.org/pushrocks/gulp-function/dev-status.svg)](https://david-dm.org/pushrocks/gulp-function#info=devDependencies)
[![bitHound Code](https://www.bithound.io/github/pushrocks/gulp-function/badges/code.svg)](https://www.bithound.io/github/pushrocks/gulp-function)
[![Coverage Status](https://coveralls.io/repos/github/pushrocks/gulp-function/badge.svg?branch=master)](https://coveralls.io/github/pushrocks/gulp-function?branch=master)
### Usage ### Usage
```javascript ```javascript
var gulp = require("gulp"); var gulp = require("gulp");
var gulpCallFunction = require("gulp-callfunction"); var gulpFunction = require("gulp-function");
var Q = require("q");
var myFunction = function () { var myFunction = function () {
var done = Q.defer();
console.log("Hello World!") console.log("Hello World!")
// NOTE:
// you can use done.resolve as callback function
// of any async tasks within this function
done.resolve();
return done.promise;
} }
gulp.task('gulpTest',function() { gulp.task('gulpTest',function() {
gulp.src('./mydir/*.something') gulp.src('./mydir/*.something')
.pipe(gulpCallFunction(myFunction,'forEach')) .pipe(gulpFunction(myFunction,'forEach')) //read the notes below
.pipe(gulp.dest("./build/")) .pipe(gulp.dest("./build/"))
}); });
``` ```
>Note: The first argument of gulpCallFunction can also be an array of multiple functionnames. > Note: The first argument of gulpFunction can also be an array of multiple functionnames.
>Note: the second argument can be empty (defaults to 'forEach') or 'atEnd' Each function can return a promise. the pipe stop will finish when every promise is fullfilled.
> Note: the second argument can be empty (defaults to 'forEach') or 'atEnd'

6
index.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
/// <reference path="ts/typings/main.d.ts" />
declare var plugins: {
beautylog: any;
Q: any;
through: any;
};

View File

@ -1,48 +1,57 @@
/// <reference path="typings/tsd.d.ts" /> #!/usr/bin/env node
var through = require("through2");
var path = require("path"); /// <reference path="typings/main.d.ts" />
var beautylog = require("beautylog"); var plugins = {
//important vars beautylog: require("beautylog"),
var gulpCallFunction = { Q: require("q"),
executionMode: 'forEach', through: require("through2")
functionsToExecute: undefined,
logBool: false
}; };
var runFunctionNames = function () { module.exports = function (functionsToExecuteArg, executionModeArg) {
if (typeof gulpCallFunction.functionsToExecute == "function") { if (executionModeArg === void 0) { executionModeArg = 'forEach'; }
gulpCallFunction.functionsToExecute(); //important vars
} var executionMode = executionModeArg; //can be forEach or atEnd
else if (Array.isArray(gulpCallFunction.functionsToExecute)) { var functionsToExecute = functionsToExecuteArg;
for (var anyFunction in gulpCallFunction.functionsToExecute) { var promiseArray = [];
anyFunction(); var runFunction = function (functionArg) {
var returnValue = functionArg();
if (typeof returnValue !== "undefined" && typeof returnValue.then !== "undefined") {
promiseArray.push(returnValue);
} }
} };
else { var checkAndRunFunction = function () {
beautylog.error('gulp-callfunction: something is strange with the given arguments'); if (typeof functionsToExecute === "function") {
} runFunction(functionsToExecute);
}; }
var forEach = function (file, enc, cb) { else if (Array.isArray(functionsToExecute)) {
if (gulpCallFunction.logBool) for (var anyFunction in functionsToExecute) {
beautylog.log(gulpCallFunction.executionMode); runFunction(functionsToExecute[anyFunction]);
if (gulpCallFunction.executionMode === 'forEach') { }
if (gulpCallFunction.logBool) }
beautylog.log('is forEach'); else {
runFunctionNames(); plugins.beautylog.error('gulp-callfunction: something is strange with the given arguments');
} }
//tell gulp that we are complete return plugins.Q.all(promiseArray);
return cb(null, file); };
}; var forEach = function (file, enc, cb) {
var atEnd = function (cb) { if (executionMode === 'forEach') {
if (gulpCallFunction.executionMode == "atEnd") { checkAndRunFunction().then(function () {
runFunctionNames(); cb(null, file);
} });
cb(); }
}; else {
module.exports = function (functionsToExecute, executionMode, logBool) { cb(null, file);
if (executionMode === void 0) { executionMode = 'forEach'; } }
if (logBool === void 0) { logBool = false; } //tell gulp that we are complete
gulpCallFunction.functionsToExecute = functionsToExecute; };
gulpCallFunction.executionMode = executionMode; var atEnd = function (cb) {
gulpCallFunction.logBool = logBool; if (executionMode === "atEnd") {
return through.obj(forEach, atEnd); checkAndRunFunction().then(function () {
cb();
});
}
else {
cb();
}
};
return plugins.through.obj(forEach, atEnd);
}; };

4
npmts.json Normal file
View File

@ -0,0 +1,4 @@
{
"mode":"default",
"coveralls":true
}

View File

@ -1,35 +1,36 @@
{ {
"name": "gulp-callfunction", "name": "gulp-function",
"version": "0.0.8", "version": "1.1.0",
"description": "accepts a function call as parameter to execute in gulp pipeline", "description": "accepts a function call as parameter to execute in gulp pipeline",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "(cd ts/compile && node compile.js) && (node test.js)", "test": "(npmts)",
"reinstall": "(rm -r node_modules && npm install)", "reinstall": "(rm -r node_modules && npm install)",
"release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)", "release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)",
"startdev": "(git checkout master && git pull origin master)" "startdev": "(git checkout master && git pull origin master)"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/pushrocks/gulp-callfunction.git" "url": "https://github.com/pushrocks/gulp-function.git"
}, },
"keywords": [ "keywords": [
"json", "gulpplugin",
"jade", "gulp",
"template" "function"
], ],
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)", "author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://github.com/pushrocks/gulp-callfunction/issues" "url": "https://github.com/pushrocks/gulp-function/issues"
},
"homepage": "https://github.com/pushrocks/gulp-callfunction",
"devDependencies": {
"gulp": "^3.9.0",
"gulp-typescript": "^2.9.2"
}, },
"homepage": "https://github.com/pushrocks/gulp-function",
"dependencies": { "dependencies": {
"beautylog": "0.0.15", "beautylog": "^2.1.1",
"through2": "^2.0.0" "q": "^1.4.1",
"through2": "^2.0.1"
},
"devDependencies": {
"gulp": "^3.9.1",
"npmts": "^2.2.3"
} }
} }

12
test.js
View File

@ -1,12 +0,0 @@
/// <reference path="typings/tsd.d.ts" />
var gulp = require("gulp");
var gulpCallFunction = require("./index.js");
var myFunction = function () {
console.log("Hello World!");
};
gulp.task('default', function () {
gulp.src('./test/test.md')
.pipe(gulpCallFunction(myFunction, 'forEach'))
.pipe(gulp.dest("./test/result/"));
});
gulp.start.apply(gulp, ['default']);

8
test/test.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/// <reference path="ts/typings/main.d.ts" />
declare var gulp: any;
declare var gulpFunction: any;
declare var beautylog: any;
declare var Q: any;
declare var myFunction: () => any;
declare var myFunction2: () => any;
declare var myFunction3: () => any;

45
test/test.js Normal file
View File

@ -0,0 +1,45 @@
#!/usr/bin/env node
/// <reference path="typings/main.d.ts" />
var gulp = require("gulp");
var gulpFunction = require("../index.js");
var beautylog = require("beautylog");
var Q = require("q");
var myFunction = function () {
var done = Q.defer();
beautylog.log("Function executed");
done.resolve();
return done.promise;
};
var myFunction2 = function () {
var done = Q.defer();
beautylog.ok("Function2 executed");
done.resolve();
return done.promise;
};
var myFunction3 = function () {
var done = Q.defer();
beautylog.success("Function3 executed");
done.resolve();
return done.promise;
};
describe("gulpFunction", function () {
it("should run through smoothly with " + "'forEach'".blue, function (done) {
gulp.src('./test/*.md')
.pipe(gulpFunction(myFunction, 'forEach'))
.pipe(gulp.dest("./test/result/"));
gulp.src('./test/*.md')
.pipe(gulpFunction([myFunction2, myFunction3], 'forEach'))
.pipe(gulp.dest("./test/result/"))
.pipe(gulpFunction(done, "atEnd"));
});
it("should run through smoothly with " + "'atEnd'".blue, function (done) {
gulp.src('./test/*.md')
.pipe(gulpFunction(myFunction, 'atEnd'))
.pipe(gulp.dest("./test/result/"));
gulp.src('./test/*.md')
.pipe(gulpFunction([myFunction2, myFunction3], 'atEnd'))
.pipe(gulp.dest("./test/result/"))
.pipe(gulpFunction(done, "atEnd"));
});
});

View File

@ -1,2 +0,0 @@
# Test.md
This is a test file for the test.js gulp pipeline

2
test/test02.md Normal file
View File

@ -0,0 +1,2 @@
# Test.md
This is another test file for the test.js gulp pipeline

View File

@ -1,26 +0,0 @@
// import gulp
var gulp = require("gulp"),
gulpTypescript = require("gulp-typescript");
gulp.task('compileTS', function() {
var stream = gulp.src('../index.ts')
.pipe(gulpTypescript({
out: "index.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('compileTestTS', function() {
var stream = gulp.src('../test.ts')
.pipe(gulpTypescript({
out: "test.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('default',['compileTS','compileTestTS'], function() {
console.log('Typescript compiled');
});
gulp.start.apply(gulp, ['default']);

View File

@ -1,2 +0,0 @@
nvm use v0.12.7
gulp

View File

@ -1,2 +0,0 @@
# How to compile.
Make sure gulp and gulp-taypescript from npm are available. Then run the gulpfile in this directory.

View File

@ -1,47 +1,60 @@
/// <reference path="typings/tsd.d.ts" /> /// <reference path="typings/main.d.ts" />
var through = require("through2");
var path = require("path");
var beautylog = require("beautylog");
//important vars var plugins = {
var gulpCallFunction = { beautylog: require("beautylog"),
executionMode: 'forEach', //can be forEach or atEnd Q: require("q"),
functionsToExecute: undefined, through: require("through2")
logBool: false }
};
var runFunctionNames = function () {
if (typeof gulpCallFunction.functionsToExecute == "function" ) {
gulpCallFunction.functionsToExecute();
} else if (Array.isArray(gulpCallFunction.functionsToExecute)) { module.exports = function (functionsToExecuteArg:any|any[],executionModeArg:string = 'forEach') {
for (var anyFunction in gulpCallFunction.functionsToExecute) { //important vars
anyFunction(); var executionMode = executionModeArg; //can be forEach or atEnd
var functionsToExecute = functionsToExecuteArg;
var promiseArray = [];
var runFunction = function(functionArg){
var returnValue = functionArg();
if (typeof returnValue !== "undefined" && typeof returnValue.then !== "undefined") {
promiseArray.push(returnValue);
} }
} else { };
beautylog.error('gulp-callfunction: something is strange with the given arguments');
} var checkAndRunFunction = function () {
}; if (typeof functionsToExecute === "function" ) {
runFunction(functionsToExecute);
} else if (Array.isArray(functionsToExecute)) {
for (var anyFunction in functionsToExecute) {
runFunction(functionsToExecute[anyFunction]);
}
} else {
plugins.beautylog.error('gulp-callfunction: something is strange with the given arguments');
}
return plugins.Q.all(promiseArray);
};
var forEach = function (file, enc, cb) { var forEach = function (file, enc, cb) {
if (gulpCallFunction.logBool) beautylog.log(gulpCallFunction.executionMode); if (executionMode === 'forEach') {
if (gulpCallFunction.executionMode === 'forEach') { checkAndRunFunction().then(function(){
if(gulpCallFunction.logBool) beautylog.log('is forEach'); cb(null, file);
runFunctionNames(); });
} } else {
//tell gulp that we are complete cb(null, file);
return cb(null, file); }
}; //tell gulp that we are complete
var atEnd = function(cb) { };
if (gulpCallFunction.executionMode == "atEnd") {
runFunctionNames(); var atEnd = function(cb) {
} if (executionMode === "atEnd") {
cb(); checkAndRunFunction().then(function(){
}; cb();
module.exports = function (functionsToExecute:any|any[],executionMode:string = 'forEach', logBool = false) { });
gulpCallFunction.functionsToExecute = functionsToExecute; } else {
gulpCallFunction.executionMode = executionMode; cb();
gulpCallFunction.logBool = logBool; }
return through.obj(forEach,atEnd); };
return plugins.through.obj(forEach,atEnd);
}; };

View File

@ -1,14 +1,50 @@
/// <reference path="typings/tsd.d.ts" /> /// <reference path="typings/main.d.ts" />
var gulp = require("gulp"); var gulp = require("gulp");
var gulpCallFunction = require("./index.js"); var gulpFunction = require("../index.js");
var beautylog = require("beautylog");
var Q = require("q");
var myFunction = function () { var myFunction = function () {
console.log("Hello World!"); var done = Q.defer()
} beautylog.log("Function executed");
done.resolve();
return done.promise;
};
var myFunction2 = function () {
var done = Q.defer();
beautylog.ok("Function2 executed");
done.resolve();
return done.promise;
};
var myFunction3 = function () {
var done = Q.defer();
beautylog.success("Function3 executed");
done.resolve();
return done.promise;
};
gulp.task('default',function() { describe("gulpFunction",function(){
gulp.src('./test/test.md') it("should run through smoothly with " + "'forEach'".blue,function(done){
.pipe(gulpCallFunction(myFunction,'forEach')) gulp.src('./test/*.md')
.pipe(gulp.dest("./test/result/")) .pipe(gulpFunction(myFunction,'forEach'))
.pipe(gulp.dest("./test/result/"));
gulp.src('./test/*.md')
.pipe(gulpFunction([myFunction2,myFunction3],'forEach'))
.pipe(gulp.dest("./test/result/"))
.pipe(gulpFunction(done,"atEnd"));
});
it("should run through smoothly with " + "'atEnd'".blue,function(done){
gulp.src('./test/*.md')
.pipe(gulpFunction(myFunction,'atEnd'))
.pipe(gulp.dest("./test/result/"));
gulp.src('./test/*.md')
.pipe(gulpFunction([myFunction2,myFunction3],'atEnd'))
.pipe(gulp.dest("./test/result/"))
.pipe(gulpFunction(done,"atEnd"));
});
}); });
gulp.start.apply(gulp, ['default']);

7
ts/typings.json Normal file
View File

@ -0,0 +1,7 @@
{
"ambientDependencies": {
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts",
"mocha": "github:Bartvds/tsd-deftools/typings/DefinitelyTyped/mocha/mocha.d.ts",
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts"
}
}

View File

@ -1,123 +0,0 @@
// Type definitions for Colors.js 0.6.0-1
// Project: https://github.com/Marak/colors.js
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "colors" {
interface Color {
(text: string): string;
black: Color;
red: Color;
green: Color;
yellow: Color;
blue: Color;
magenta: Color;
cyan: Color;
white: Color;
gray: Color;
grey: Color;
bgBlack: Color;
bgRed: Color;
bgGreen: Color;
bgYellow: Color;
bgBlue: Color;
bgMagenta: Color;
bgCyan: Color;
bgWhite: Color;
reset: Color;
bold: Color;
dim: Color;
italic: Color;
underline: Color;
inverse: Color;
hidden: Color;
strikethrough: Color;
rainbow: Color;
zebra: Color;
america: Color;
trap: Color;
random: Color;
}
module e {
export function setTheme(theme:any): void;
export var black: Color;
export var red: Color;
export var green: Color;
export var yellow: Color;
export var blue: Color;
export var magenta: Color;
export var cyan: Color;
export var white: Color;
export var gray: Color;
export var grey: Color;
export var bgBlack: Color;
export var bgRed: Color;
export var bgGreen: Color;
export var bgYellow: Color;
export var bgBlue: Color;
export var bgMagenta: Color;
export var bgCyan: Color;
export var bgWhite: Color;
export var reset: Color;
export var bold: Color;
export var dim: Color;
export var italic: Color;
export var underline: Color;
export var inverse: Color;
export var hidden: Color;
export var strikethrough: Color;
export var rainbow: Color;
export var zebra: Color;
export var america: Color;
export var trap: Color;
export var random: Color;
}
export = e;
}
interface String {
black: string;
red: string;
green: string;
yellow: string;
blue: string;
magenta: string;
cyan: string;
white: string;
gray: string;
grey: string;
bgBlack: string;
bgRed: string;
bgGreen: string;
bgYellow: string;
bgBlue: string;
bgMagenta: string;
bgCyan: string;
bgWhite: string;
reset: string;
bold: string;
dim: string;
italic: string;
underline: string;
inverse: string;
hidden: string;
strikethrough: string;
rainbow: string;
zebra: string;
america: string;
trap: string;
random: string;
}

File diff suppressed because it is too large Load Diff

2
ts/typings/tsd.d.ts vendored
View File

@ -1,2 +0,0 @@
/// <reference path="node/node.d.ts" />
/// <reference path="colors/colors.d.ts" />