Skip to content

Commit

Permalink
Merge pull request Houfeng#11 from Houfeng/dev
Browse files Browse the repository at this point in the history
0.3.5
  • Loading branch information
Houfeng authored Jan 7, 2017
2 parents 926be82 + a1f50b2 commit 2a2818d
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 26 deletions.
2 changes: 1 addition & 1 deletion demo/cizefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
**/
cize.config({
secret: '12345',
mode: 'new-process'
//mode: 'new-process'
});

/**
Expand Down
5 changes: 3 additions & 2 deletions lib/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ const Context = new Class({
/**
* 继承 EventEmitter
**/
_extends: EventEmitter,
$extends: EventEmitter,

/**
* Context 的构建函数
* @param {Project} project 所属 project
* @param {Object} params 执行参数
**/
constructor: function (project, params, parent) {
EventEmitter.call(this);
if (!project) {
throw new Error('Invalid parameter: project');
}
Expand Down Expand Up @@ -119,7 +120,7 @@ const Context = new Class({
var TheJob = null;
if (utils.isString(job)) {
TheJob = self.project.job(job);
} else if (job && job.extendsOf && job.extendsOf(Job)) {
} else {
TheJob = job;
}
if (!TheJob) {
Expand Down
7 changes: 4 additions & 3 deletions lib/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ const Job = new Class({
/**
* 继承 EventEmitter
**/
_extends: EventEmitter,
$extends: EventEmitter,

/**
* Job 的构造函数
* @runable {Function} 可以运行的 Function
**/
constructor: function (context, options) {
EventEmitter.call(this);
if (!context) {
throw new Error('Invalid parameter: context');
}
Expand Down Expand Up @@ -193,7 +194,7 @@ const Job = new Class({
**/
_triggerEndEvent: function () {
var self = this;
self._static.emit(JOB_END_EVENT, self);
self.$class.emit(JOB_END_EVENT, self);
self.project.emit(`${JOB_END_EVENT}:${self.name}`, self);
self.project.emit(JOB_END_EVENT, self);
self.server.emit(`${JOB_END_EVENT}:${self.project.name}.${self.name}`, self);
Expand All @@ -205,7 +206,7 @@ const Job = new Class({
**/
_triggerBeginEvent: function () {
var self = this;
self._static.emit(JOB_BEGIN_EVENT, self);
self.$class.emit(JOB_BEGIN_EVENT, self);
self.project.emit(`${JOB_BEGIN_EVENT}:${self.name}`, self);
self.project.emit(JOB_BEGIN_EVENT, self);
self.server.emit(`${JOB_BEGIN_EVENT}:${self.project.name}.${self.name}`, self);
Expand Down
5 changes: 3 additions & 2 deletions lib/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Project = new Class({
/**
* 继承 EventEmitter
**/
_extends: EventEmitter,
$extends: EventEmitter,

/**
* Project 的构造函数
Expand All @@ -18,6 +18,7 @@ const Project = new Class({
* @param {Object} options 项目选项
**/
constructor: function (server, name, options) {
EventEmitter.call(this);
if (!server) {
throw new Error('Invalid parameters: sever');
}
Expand Down Expand Up @@ -88,7 +89,7 @@ const Project = new Class({
throw new Error('Invalid parameter: runable');
}
var NewJob = new Class({
_extends: Job,
$extends: Job,
name: name,
isAbstract: false
});
Expand Down
3 changes: 2 additions & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ const Server = new Class({
/**
* 继承 EventEmitter
**/
_extends: EventEmitter,
$extends: EventEmitter,

/**
* Server 的构造函数
* 可以通过 options 构造一个 CI Server 实例
* @param {Object} options 'Server 选项'
**/
constructor: function (options) {
EventEmitter.call(this);
this.options = {};
this.projects = {};
this.config(options);
Expand Down
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cize",
"version": "0.3.2",
"version": "0.3.5",
"dbVersion": "1",
"description": "Cize 是一个「持续集成」工具",
"main": "index.js",
Expand Down Expand Up @@ -29,27 +29,27 @@
},
"license": "MIT",
"dependencies": {
"ansi-to-html": "^0.4.1",
"ansi-to-html-umd": "^0.4.2",
"async": "^1.5.2",
"bootstrap": "^3.3.7",
"chokidar": "^1.6.0",
"cify": "^1.0.2",
"cmdline": "^1.1.7",
"console3": "^1.0.3",
"cron": "^1.1.0",
"chokidar": "^1.6.1",
"cify": "^2.1.1",
"cmdline": "^2.0.2",
"console3": "^1.0.4",
"cron": "^1.2.1",
"exit-hook2": "^1.0.8",
"font-awesome": "^4.6.3",
"font-awesome": "^4.7.0",
"jquery": "^2.2.4",
"js-yaml": "^3.6.1",
"jwt-simple": "^0.5.0",
"lodash": "^4.14.2",
"md5": "^2.1.0",
"js-yaml": "^3.7.0",
"jwt-simple": "^0.5.1",
"lodash": "^4.17.4",
"md5": "^2.2.1",
"mkdir-p": "0.0.7",
"nokit-pjax": "^0.2.0",
"nokitjs": "^1.25.7",
"ntils": "^1.0.2",
"orm": "^3.1.0",
"request": "^2.74.0",
"nokitjs": "^1.26.3",
"ntils": "^2.0.3",
"orm": "^3.2.3",
"request": "^2.79.0",
"rmdir": "^1.2.0",
"shify": "^0.1.2",
"sqlite3": "^3.1.4",
Expand Down
2 changes: 1 addition & 1 deletion web/common/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const utils = nokit.utils;
utils.pkg = require('../../package.json');
const Convert = require('ansi-to-html');
const Convert = require('ansi-to-html-umd');

const convert = new Convert({
fg: '#333',
Expand Down

0 comments on commit 2a2818d

Please sign in to comment.