add travis
This commit is contained in:
parent
e7b0b77987
commit
5762561e5a
0
.npmignore
Normal file
0
.npmignore
Normal file
11
.travis.yml
Normal file
11
.travis.yml
Normal file
@ -0,0 +1,11 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- stable
|
||||
deploy:
|
||||
provider: npm
|
||||
email: npm@lossless.digital
|
||||
api_key:
|
||||
secure: NejErc2+ohEEH8DecYcx6/2oSdEQQBRzlOwTMxQBftHdIkvziwOcCerqCJtrXuzalqAofVCcVisunWIXZmxfIBGV6mJVauCIp5KzH4JUhYzLym33p9MSphjlPNfsI6nKkW0LAgOMjkJGuHLqU3oskvBqYyh8m3NuCna5mNwm8lo5WGckzHSwdsmhnb839WhlZbmQc6M6WW6Ir7bbxX9ZOmNUYUWH6VdXfPBxoXN3nO21pXKt7Zg8/nU7IkF+VEUVfYNlR3xUiocWemuBFxjtsfoliQ/y/oGL7ccQ7OeE4PxSu+xNUpYYVipkQcRtyWDKCwJp4R2DNTj/ikOHH+BEFOBDG8qYxwf37Ju0jFybzslAEJLy5gl4bFjiZNA8ldUXY5ubJb56iZTNSbMU0lmXw+qKvIoyVY/1JAE5lzFGVA6nDdiUGAEOg/ajzAC3gjFU2QS2Wvncz3dky0k/2INBVUwmmAvAMazl5XkvHtQ3Wzb+Fc8TXWflqBDF0okySoJzlY13pm/OtOHipiqEyUCnqaUUwJtLIb6tHOPzxZKlWLCem7y84cDlxQSbLVItbArOJFHdr66sp/U/FqYAtWeLdbkhjCENFwzR9kYtEyEl+QWLTckO1/lVF4xJLh6drfhQ66CwF5bfqr5xIS08mnKuYBfJOA4/wV4bQFPhtYm7Oi8=
|
||||
on:
|
||||
tags: true
|
||||
repo: pushrocks/taskbuffer
|
11
README.md
Normal file
11
README.md
Normal file
@ -0,0 +1,11 @@
|
||||
# taskbuffer
|
||||
Flexible task organization for gulp.
|
||||
|
||||
## Status
|
||||
[![Coverage Status](https://coveralls.io/repos/github/pushrocks/taskbuffer/badge.svg?branch=master)](https://coveralls.io/github/pushrocks/taskbuffer?branch=master)
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install taskbuffer --save
|
||||
```
|
9
dist/index.js
vendored
Normal file
9
dist/index.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var task = require("./taskbuffer.task");
|
||||
var taskbuffer = {
|
||||
task: task
|
||||
};
|
||||
module.exports = taskbuffer;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBLElBQU8sSUFBSSxXQUFXLG1CQUFtQixDQUFDLENBQUM7QUFHM0MsSUFBSSxVQUFVLEdBQUc7SUFDYixJQUFJLEVBQUUsSUFBSTtDQUNiLENBQUM7QUFFRixpQkFBUyxVQUFVLENBQUMiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG5pbXBvcnQgcGx1Z2lucyA9IHJlcXVpcmUoXCIuL3Rhc2tidWZmZXIucGx1Z2luc1wiKTtcbmltcG9ydCBjbGFzc2VzID0gcmVxdWlyZShcIi4vdGFza2J1ZmZlci5jbGFzc2VzXCIpO1xuaW1wb3J0IHRhc2sgPSByZXF1aXJlKFwiLi90YXNrYnVmZmVyLnRhc2tcIik7XG5pbXBvcnQgdGFza2NoYWluID0gcmVxdWlyZShcIi4vdGFza2J1ZmZlci50YXNrY2hhaW5cIik7XG5cbnZhciB0YXNrYnVmZmVyID0ge1xuICAgIHRhc2s6IHRhc2tcbn07XG5cbmV4cG9ydCA9IHRhc2tidWZmZXI7Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
|
52
dist/taskbuffer.classes.js
vendored
Normal file
52
dist/taskbuffer.classes.js
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = require("./taskbuffer.plugins");
|
||||
var Task = (function () {
|
||||
function Task(taskArg, optionsArg) {
|
||||
this.task = taskArg;
|
||||
}
|
||||
Task.prototype.trigger = function () {
|
||||
this.preTask.task()
|
||||
.then(this.task)
|
||||
.then(this.afterTask.task);
|
||||
};
|
||||
;
|
||||
Task.prototype.triggerBuffered = function () {
|
||||
var done = plugins.Q.defer();
|
||||
};
|
||||
Object.defineProperty(Task.prototype, "state", {
|
||||
get: function () {
|
||||
return this._state;
|
||||
},
|
||||
set: function (stateArg) {
|
||||
if (stateArg == "locked") {
|
||||
this._state = "locked";
|
||||
}
|
||||
else {
|
||||
plugins.beautylog.error("state type");
|
||||
}
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return Task;
|
||||
})();
|
||||
exports.Task = Task;
|
||||
var TaskChain = (function (_super) {
|
||||
__extends(TaskChain, _super);
|
||||
function TaskChain(taskArrayArg) {
|
||||
_super.call(this, {
|
||||
task: function () { }
|
||||
});
|
||||
}
|
||||
return TaskChain;
|
||||
})(Task);
|
||||
exports.TaskChain = TaskChain;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIuY2xhc3Nlcy50cyJdLCJuYW1lcyI6WyJUYXNrIiwiVGFzay5jb25zdHJ1Y3RvciIsIlRhc2sudHJpZ2dlciIsIlRhc2sudHJpZ2dlckJ1ZmZlcmVkIiwiVGFzay5zdGF0ZSIsIlRhc2tDaGFpbiIsIlRhc2tDaGFpbi5jb25zdHJ1Y3RvciJdLCJtYXBwaW5ncyI6Ij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oaXMuYWZ0ZXJUYXNrLnRhc2spO1xuICAgIH07XG4gICAgdHJpZ2dlckJ1ZmZlcmVkKCl7XG4gICAgICAgIHZhciBkb25lID0gcGx1Z2lucy5RLmRlZmVyKCk7XG4gICAgfVxuXG4gICAgZ2V0IHN0YXRlKCk6c3RyaW5nIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX3N0YXRlO1xuICAgIH1cbiAgICBzZXQgc3RhdGUoc3RhdGVBcmc6c3RyaW5nKXtcbiAgICAgICAgaWYgKHN0YXRlQXJnID09IFwibG9ja2VkXCIpe1xuICAgICAgICAgICAgdGhpcy5fc3RhdGUgPSBcImxvY2tlZFwiO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcGx1Z2lucy5iZWF1dHlsb2cuZXJyb3IoXCJzdGF0ZSB0eXBlXCIgKTtcbiAgICAgICAgfVxuICAgIH1cbn1cblxuZXhwb3J0IGNsYXNzIFRhc2tDaGFpbiBleHRlbmRzIFRhc2sge1xuICAgIGNvbnN0cnVjdG9yKHRhc2tBcnJheUFyZzpUYXNrW10pe1xuICAgICAgICBzdXBlcih7XG4gICAgICAgICAgICB0YXNrOmZ1bmN0aW9uKCl7fVxuICAgICAgICB9KTtcbiAgICB9XG59Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
|
10
dist/taskbuffer.plugins.js
vendored
Normal file
10
dist/taskbuffer.plugins.js
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = {
|
||||
beautylog: require("beautylog"),
|
||||
Q: require("q")
|
||||
};
|
||||
module.exports = plugins;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBSSxPQUFPLEdBQUc7SUFDVixTQUFTLEVBQUUsT0FBTyxDQUFDLFdBQVcsQ0FBQztJQUMvQixDQUFDLEVBQUUsT0FBTyxDQUFDLEdBQUcsQ0FBQztDQUNsQixDQUFDO0FBQ0YsaUJBQVMsT0FBTyxDQUFDIiwiZmlsZSI6InRhc2tidWZmZXIucGx1Z2lucy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbnZhciBwbHVnaW5zID0ge1xuICAgIGJlYXV0eWxvZzogcmVxdWlyZShcImJlYXV0eWxvZ1wiKSxcbiAgICBROiByZXF1aXJlKFwicVwiKVxufTtcbmV4cG9ydCA9IHBsdWdpbnM7XG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
5
dist/taskbuffer.promisechain.js
vendored
Normal file
5
dist/taskbuffer.promisechain.js
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIucHJvbWlzZWNoYWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QyIsImZpbGUiOiJ0YXNrYnVmZmVyLnByb21pc2VjaGFpbi5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
11
dist/taskbuffer.task.js
vendored
Normal file
11
dist/taskbuffer.task.js
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var classes = require("./taskbuffer.classes");
|
||||
var task = function (taskArg, options) {
|
||||
var task = taskArg;
|
||||
return new classes.Task(task, options);
|
||||
};
|
||||
module.exports = task;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIudGFzay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcsc0JBQXNCLENBQUMsQ0FBQztBQUNqRCxJQUFJLElBQUksR0FBRyxVQUFTLE9BQU8sRUFBQyxPQUFRO0lBQ2hDLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQTtJQUNsQixNQUFNLENBQUMsSUFBSSxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksRUFBQyxPQUFPLENBQUMsQ0FBQztBQUMxQyxDQUFDLENBQUM7QUFDRixpQkFBUyxJQUFJLENBQUMiLCJmaWxlIjoidGFza2J1ZmZlci50YXNrLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxuaW1wb3J0IGNsYXNzZXMgPSByZXF1aXJlKFwiLi90YXNrYnVmZmVyLmNsYXNzZXNcIik7XG52YXIgdGFzayA9IGZ1bmN0aW9uKHRhc2tBcmcsb3B0aW9ucz8pe1xuICAgIHZhciB0YXNrID0gdGFza0FyZ1xuICAgIHJldHVybiBuZXcgY2xhc3Nlcy5UYXNrKHRhc2ssb3B0aW9ucyk7XG59O1xuZXhwb3J0ID0gdGFzazsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
10
dist/taskbuffer.taskchain.js
vendored
Normal file
10
dist/taskbuffer.taskchain.js
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var classes = require("./taskbuffer.classes");
|
||||
var taskChain = function (taskArrayArg) {
|
||||
return new classes.TaskChain(taskArrayArg);
|
||||
};
|
||||
module.exports = taskChain;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIudGFza2NoYWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUM1QyxJQUFPLE9BQU8sV0FBVyxzQkFBc0IsQ0FBQyxDQUFDO0FBQ2pELElBQUksU0FBUyxHQUFHLFVBQVMsWUFBMkI7SUFFaEQsTUFBTSxDQUFDLElBQUksT0FBTyxDQUFDLFNBQVMsQ0FBQyxZQUFZLENBQUMsQ0FBQztBQUMvQyxDQUFDLENBQUM7QUFDRixpQkFBUyxTQUFTLENBQUMiLCJmaWxlIjoidGFza2J1ZmZlci50YXNrY2hhaW4uanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG5pbXBvcnQgY2xhc3NlcyA9IHJlcXVpcmUoXCIuL3Rhc2tidWZmZXIuY2xhc3Nlc1wiKTtcbnZhciB0YXNrQ2hhaW4gPSBmdW5jdGlvbih0YXNrQXJyYXlBcmc6Y2xhc3Nlcy5UYXNrW10pe1xuXG4gICAgcmV0dXJuIG5ldyBjbGFzc2VzLlRhc2tDaGFpbih0YXNrQXJyYXlBcmcpO1xufTtcbmV4cG9ydCA9IHRhc2tDaGFpbjtcbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
|
27
index.d.ts
vendored
27
index.d.ts
vendored
@ -1,27 +0,0 @@
|
||||
/// <reference path="ts/typings/main.d.ts" />
|
||||
declare module TaskbufferPlugins {
|
||||
var init: () => void;
|
||||
}
|
||||
declare class Task {
|
||||
task: any;
|
||||
state: string;
|
||||
idle: boolean;
|
||||
preTask: Task;
|
||||
afterTask: Task;
|
||||
constructor(taskArg: any, optionsArg: {
|
||||
preTask?: Task;
|
||||
afterTask?: Task;
|
||||
});
|
||||
trigger(): void;
|
||||
triggerBuffered(): void;
|
||||
}
|
||||
declare class TaskChain extends Task {
|
||||
constructor(taskArrayArg: Task[]);
|
||||
}
|
||||
declare module TaskbufferTask {
|
||||
var init: () => (taskArg: any, options?: any) => Task;
|
||||
}
|
||||
declare module TaskbufferTaskchain {
|
||||
var init: () => any;
|
||||
}
|
||||
declare var plugins: void;
|
63
index.js
63
index.js
@ -1,63 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="./index.ts" />
|
||||
var TaskbufferPlugins;
|
||||
(function (TaskbufferPlugins) {
|
||||
TaskbufferPlugins.init = function () {
|
||||
var plugins = {
|
||||
q: require("q")
|
||||
};
|
||||
};
|
||||
})(TaskbufferPlugins || (TaskbufferPlugins = {}));
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
/// <reference path="./index.ts" />
|
||||
var Task = (function () {
|
||||
function Task(taskArg, optionsArg) {
|
||||
this.task = taskArg;
|
||||
}
|
||||
Task.prototype.trigger = function () { };
|
||||
;
|
||||
Task.prototype.triggerBuffered = function () {
|
||||
};
|
||||
return Task;
|
||||
})();
|
||||
var TaskChain = (function (_super) {
|
||||
__extends(TaskChain, _super);
|
||||
function TaskChain(taskArrayArg) {
|
||||
_super.call(this, {
|
||||
task: function () { }
|
||||
});
|
||||
}
|
||||
return TaskChain;
|
||||
})(Task);
|
||||
/// <reference path="./index.ts" />
|
||||
var TaskbufferTask;
|
||||
(function (TaskbufferTask) {
|
||||
TaskbufferTask.init = function () {
|
||||
var task = function (taskArg, options) {
|
||||
var task = taskArg;
|
||||
return new Task(task, options);
|
||||
};
|
||||
return task;
|
||||
};
|
||||
})(TaskbufferTask || (TaskbufferTask = {}));
|
||||
/// <reference path="./index.ts" />
|
||||
var TaskbufferTaskchain;
|
||||
(function (TaskbufferTaskchain) {
|
||||
TaskbufferTaskchain.init = function () {
|
||||
var taskChain = function (taskArrayArg) {
|
||||
return new TaskChain();
|
||||
};
|
||||
return taskChain();
|
||||
};
|
||||
})(TaskbufferTaskchain || (TaskbufferTaskchain = {}));
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
/// <reference path="./taskbuffer.plugins.ts" />
|
||||
/// <reference path="./taskbuffer.classes.ts" />
|
||||
/// <reference path="./taskbuffer.task.ts" />
|
||||
/// <reference path="./taskbuffer.taskchain.ts" />
|
||||
var plugins = TaskbufferPlugins.init();
|
4
npmts.json
Normal file
4
npmts.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"mode":"default",
|
||||
"coveralls":true
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
"name": "taskbuffer",
|
||||
"version": "0.0.0",
|
||||
"description": "manage triggers and execution of tasks with promises",
|
||||
"main": "index.js",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"test": "(npmts)"
|
||||
},
|
||||
@ -23,7 +23,8 @@
|
||||
},
|
||||
"homepage": "https://github.com/pushrocks/taskbuffer#readme",
|
||||
"dependencies": {
|
||||
"npmts": "^2.2.3",
|
||||
"beautylog": "^2.1.1",
|
||||
"npmts": "^3.0.2",
|
||||
"q": "^1.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
2
test/test.d.ts
vendored
2
test/test.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
/// <reference path="ts/typings/main.d.ts" />
|
||||
declare var taskbuffer: any;
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var taskbuffer = require("../index.js");
|
||||
/// <reference path="../ts/typings/main.d.ts" />
|
||||
var taskbuffer = require("../dist/index.js");
|
||||
describe("taskbuffer.task", function () {
|
||||
describe(".task", function () {
|
||||
it("should return a new task", function () {
|
||||
@ -9,3 +9,5 @@ describe("taskbuffer.task", function () {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksVUFBVSxHQUFHLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO0FBQzdDLFFBQVEsQ0FBQyxpQkFBaUIsRUFBQztJQUN2QixRQUFRLENBQUMsT0FBTyxFQUFDO1FBQ2IsRUFBRSxDQUFDLDBCQUEwQixFQUFDO1lBQzFCLElBQUksTUFBTSxHQUFHLFVBQVUsQ0FBQyxJQUFJLEVBQUUsQ0FBQztRQUNuQyxDQUFDLENBQUMsQ0FBQTtJQUNOLENBQUMsQ0FBQyxDQUFDO0FBQ1AsQ0FBQyxDQUFDLENBQUMiLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuLi90cy90eXBpbmdzL21haW4uZC50c1wiIC8+XG52YXIgdGFza2J1ZmZlciA9IHJlcXVpcmUoXCIuLi9kaXN0L2luZGV4LmpzXCIpO1xuZGVzY3JpYmUoXCJ0YXNrYnVmZmVyLnRhc2tcIixmdW5jdGlvbigpe1xuICAgIGRlc2NyaWJlKFwiLnRhc2tcIixmdW5jdGlvbigpe1xuICAgICAgICBpdChcInNob3VsZCByZXR1cm4gYSBuZXcgdGFza1wiLGZ1bmN0aW9uKCl7XG4gICAgICAgICAgICB2YXIgbXlUYXNrID0gdGFza2J1ZmZlci50YXNrKCk7XG4gICAgICAgIH0pXG4gICAgfSk7XG59KTsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
||||
|
1
test/test.js.map
Normal file
1
test/test.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,IAAI,UAAU,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC7C,QAAQ,CAAC,iBAAiB,EAAC;IACvB,QAAQ,CAAC,OAAO,EAAC;QACb,EAAE,CAAC,0BAA0B,EAAC;YAC1B,IAAI,MAAM,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;QACnC,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
@ -1,5 +1,5 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var taskbuffer = require("../index.js");
|
||||
/// <reference path="../ts/typings/main.d.ts" />
|
||||
var taskbuffer = require("../dist/index.js");
|
||||
describe("taskbuffer.task",function(){
|
||||
describe(".task",function(){
|
||||
it("should return a new task",function(){
|
15
ts/index.ts
15
ts/index.ts
@ -1,6 +1,11 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
/// <reference path="./taskbuffer.plugins.ts" />
|
||||
/// <reference path="./taskbuffer.classes.ts" />
|
||||
/// <reference path="./taskbuffer.task.ts" />
|
||||
/// <reference path="./taskbuffer.taskchain.ts" />
|
||||
var plugins = TaskbufferPlugins.init();
|
||||
import plugins = require("./taskbuffer.plugins");
|
||||
import classes = require("./taskbuffer.classes");
|
||||
import task = require("./taskbuffer.task");
|
||||
import taskchain = require("./taskbuffer.taskchain");
|
||||
|
||||
var taskbuffer = {
|
||||
task: task
|
||||
};
|
||||
|
||||
export = taskbuffer;
|
@ -1,21 +1,40 @@
|
||||
/// <reference path="./index.ts" />
|
||||
class Task {
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import plugins = require("./taskbuffer.plugins");
|
||||
export class Task {
|
||||
task:any;
|
||||
state:string;
|
||||
idle:boolean;
|
||||
buffered:boolean;
|
||||
bufferedForced:boolean;
|
||||
running:boolean;
|
||||
private _state:string;
|
||||
preTask:Task;
|
||||
afterTask:Task;
|
||||
|
||||
constructor(taskArg,optionsArg:{preTask?:Task,afterTask?:Task}){
|
||||
constructor(taskArg,optionsArg?:{preTask?:Task,afterTask?:Task}){
|
||||
this.task = taskArg;
|
||||
}
|
||||
trigger(){};
|
||||
trigger(){
|
||||
this.preTask.task()
|
||||
.then(this.task)
|
||||
.then(this.afterTask.task);
|
||||
};
|
||||
triggerBuffered(){
|
||||
var done = plugins.Q.defer();
|
||||
}
|
||||
|
||||
get state():string {
|
||||
return this._state;
|
||||
}
|
||||
set state(stateArg:string){
|
||||
if (stateArg == "locked"){
|
||||
this._state = "locked";
|
||||
} else {
|
||||
plugins.beautylog.error("state type" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TaskChain extends Task {
|
||||
export class TaskChain extends Task {
|
||||
constructor(taskArrayArg:Task[]){
|
||||
super({
|
||||
task:function(){}
|
||||
|
@ -1,8 +1,6 @@
|
||||
/// <reference path="./index.ts" />
|
||||
module TaskbufferPlugins {
|
||||
export var init = function(){
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = {
|
||||
q: require("q")
|
||||
}
|
||||
}
|
||||
}
|
||||
beautylog: require("beautylog"),
|
||||
Q: require("q")
|
||||
};
|
||||
export = plugins;
|
||||
|
@ -1 +1 @@
|
||||
/// <reference path="./index.ts" />
|
||||
/// <reference path="./typings/main.d.ts" />
|
@ -1,10 +1,7 @@
|
||||
/// <reference path="./index.ts" />
|
||||
module TaskbufferTask {
|
||||
export var init = function(){
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import classes = require("./taskbuffer.classes");
|
||||
var task = function(taskArg,options?){
|
||||
var task = taskArg
|
||||
return new Task(task,options);
|
||||
return new classes.Task(task,options);
|
||||
};
|
||||
return task;
|
||||
}
|
||||
}
|
||||
export = task;
|
@ -1,9 +1,7 @@
|
||||
/// <reference path="./index.ts" />
|
||||
module TaskbufferTaskchain {
|
||||
export var init = function(){
|
||||
var taskChain = function(taskArrayArg:Task[]){
|
||||
return new TaskChain();
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import classes = require("./taskbuffer.classes");
|
||||
var taskChain = function(taskArrayArg:classes.Task[]){
|
||||
|
||||
return new classes.TaskChain(taskArrayArg);
|
||||
};
|
||||
return taskChain();
|
||||
}
|
||||
}
|
||||
export = taskChain;
|
||||
|
Loading…
Reference in New Issue
Block a user