cleanup
This commit is contained in:
		@@ -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']);
 | 
			
		||||
@@ -1,2 +0,0 @@
 | 
			
		||||
nvm use v0.12.7
 | 
			
		||||
gulp
 | 
			
		||||
@@ -1,2 +0,0 @@
 | 
			
		||||
# How to compile.
 | 
			
		||||
Make sure gulp and gulp-taypescript from npm are available. Then run the gulpfile in this directory.
 | 
			
		||||
							
								
								
									
										22
									
								
								ts/index.ts
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								ts/index.ts
									
									
									
									
									
								
							@@ -1,22 +1,22 @@
 | 
			
		||||
/// <reference path="typings/tsd.d.ts" />
 | 
			
		||||
/// <reference path="typings/main.d.ts" />
 | 
			
		||||
var through = require("through2");
 | 
			
		||||
var path = require("path");
 | 
			
		||||
var beautylog = require("beautylog")("os");
 | 
			
		||||
var beautylog = require("beautylog");
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (functionsToExecuteArg:any|any[],executionModeArg:string = 'forEach', logBoolArg = false) {
 | 
			
		||||
    //important vars
 | 
			
		||||
    var gulpCallFunction = {
 | 
			
		||||
    var gulpFunction = {
 | 
			
		||||
        executionMode: executionModeArg, //can be forEach or atEnd
 | 
			
		||||
        functionsToExecute: functionsToExecuteArg,
 | 
			
		||||
        logBool: logBoolArg
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    var runFunctionNames = function () {
 | 
			
		||||
        if (typeof gulpCallFunction.functionsToExecute == "function" ) {
 | 
			
		||||
            gulpCallFunction.functionsToExecute();
 | 
			
		||||
        } else if (Array.isArray(gulpCallFunction.functionsToExecute)) {
 | 
			
		||||
            for (var anyFunction in gulpCallFunction.functionsToExecute) {
 | 
			
		||||
        if (typeof gulpFunction.functionsToExecute == "function" ) {
 | 
			
		||||
            gulpFunction.functionsToExecute();
 | 
			
		||||
        } else if (Array.isArray(gulpFunction.functionsToExecute)) {
 | 
			
		||||
            for (var anyFunction in gulpFunction.functionsToExecute) {
 | 
			
		||||
                anyFunction();
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
@@ -26,9 +26,9 @@ module.exports = function (functionsToExecuteArg:any|any[],executionModeArg:stri
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    var forEach = function (file, enc, cb) {
 | 
			
		||||
        if (gulpCallFunction.logBool) beautylog.log(gulpCallFunction.executionMode);
 | 
			
		||||
        if (gulpCallFunction.executionMode === 'forEach') {
 | 
			
		||||
            if(gulpCallFunction.logBool) beautylog.log('is forEach');
 | 
			
		||||
        if (gulpFunction.logBool) beautylog.log(gulpFunction.executionMode);
 | 
			
		||||
        if (gulpFunction.executionMode === 'forEach') {
 | 
			
		||||
            if(gulpFunction.logBool) beautylog.log('is forEach');
 | 
			
		||||
            runFunctionNames();
 | 
			
		||||
        }
 | 
			
		||||
        //tell gulp that we are complete
 | 
			
		||||
@@ -36,7 +36,7 @@ module.exports = function (functionsToExecuteArg:any|any[],executionModeArg:stri
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    var atEnd = function(cb) {
 | 
			
		||||
        if (gulpCallFunction.executionMode == "atEnd") {
 | 
			
		||||
        if (gulpFunction.executionMode == "atEnd") {
 | 
			
		||||
            runFunctionNames();
 | 
			
		||||
        }
 | 
			
		||||
        cb();
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										25
									
								
								ts/test.ts
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								ts/test.ts
									
									
									
									
									
								
							@@ -1,15 +1,20 @@
 | 
			
		||||
/// <reference path="typings/tsd.d.ts" />
 | 
			
		||||
/// <reference path="typings/main.d.ts" />
 | 
			
		||||
var gulp = require("gulp");
 | 
			
		||||
var gulpCallFunction = require("./index.js");
 | 
			
		||||
var beautylog = require("beautylog")("os");
 | 
			
		||||
var gulpFunction = require("../index.js");
 | 
			
		||||
var beautylog = require("beautylog");
 | 
			
		||||
 | 
			
		||||
var myFunction = function () {
 | 
			
		||||
    beautylog.log("Hello World!");
 | 
			
		||||
}
 | 
			
		||||
    beautylog.log("Mocha Test successfull!");
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
gulp.task('default',function() {
 | 
			
		||||
    gulp.src('./test/test.md')
 | 
			
		||||
        .pipe(gulpCallFunction(myFunction,'forEach'))
 | 
			
		||||
        .pipe(gulp.dest("./test/result/"))
 | 
			
		||||
describe("gulpFunction",function(){
 | 
			
		||||
    it("should run through smoothly",function(){
 | 
			
		||||
        gulp.task('default',function() {
 | 
			
		||||
            gulp.src('./test/test.md')
 | 
			
		||||
                .pipe(gulpFunction(myFunction,'forEach'))
 | 
			
		||||
                .pipe(gulp.dest("./test/result/"))
 | 
			
		||||
        });
 | 
			
		||||
        gulp.start.apply(gulp, ['default']);
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
gulp.start.apply(gulp, ['default']);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										7
									
								
								ts/typings.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								ts/typings.json
									
									
									
									
									
										Normal 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"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										123
									
								
								ts/typings/colors/colors.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										123
									
								
								ts/typings/colors/colors.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -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;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										2079
									
								
								ts/typings/node/node.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2079
									
								
								ts/typings/node/node.d.ts
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										2
									
								
								ts/typings/tsd.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								ts/typings/tsd.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -1,2 +0,0 @@
 | 
			
		||||
/// <reference path="node/node.d.ts" />
 | 
			
		||||
/// <reference path="colors/colors.d.ts" />
 | 
			
		||||
		Reference in New Issue
	
	Block a user