Comparing version 0.3.2 to 0.3.3
@@ -266,9 +266,11 @@ var Q = require('q'), | ||
return Q.invoke( | ||
job.node, | ||
'run', | ||
extend({}, this.ctx, { | ||
arch: plan.arch, | ||
plan: plan | ||
})); | ||
var ctx = extend({}, this.ctx, { | ||
arch: plan.arch, | ||
plan: plan | ||
}); | ||
job.node.ctx = ctx; | ||
return Q.invoke(job.node, 'run', ctx) | ||
.fin(function() { | ||
delete job.node.ctx; | ||
}); | ||
@@ -275,0 +277,0 @@ }, this); |
{ | ||
"name": "apw", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"homepage": "http://github.com/bem/apw", | ||
@@ -5,0 +5,0 @@ "author": "Sergey Kryzhanovsky <skryzhanovsky@ya.ru> (http://github.com/afelix)", |
@@ -35,6 +35,6 @@ var Q = require('q'), | ||
}, | ||
run: function(ctx) { | ||
run: function() { | ||
state.push('2B'); | ||
ctx.arch.addNode(createNode('2C'), '2A'); | ||
ctx.arch.addNode(createNode('2D'), '2A'); | ||
this.ctx.arch.addNode(createNode('2C'), '2A'); | ||
this.ctx.arch.addNode(createNode('2D'), '2A'); | ||
} | ||
@@ -48,8 +48,8 @@ }, '2A') | ||
}, | ||
run: function(ctx) { | ||
run: function() { | ||
state.push('3B'); | ||
return ctx.arch.withLock(function() { | ||
ctx.arch.addNode(createNode('3C'), '3A'); | ||
ctx.arch.addNode(createNode('3D'), '3A'); | ||
}); | ||
return this.ctx.arch.withLock(function() { | ||
this.ctx.arch.addNode(createNode('3C'), '3A'); | ||
this.ctx.arch.addNode(createNode('3D'), '3A'); | ||
}, this); | ||
} | ||
@@ -67,4 +67,4 @@ }, '3A') | ||
}, | ||
run: function(ctx) { | ||
ctx.plan.on('allDone', function(id) { | ||
run: function() { | ||
this.ctx.plan.on('allDone', function(id) { | ||
state.push('5B'); | ||
@@ -71,0 +71,0 @@ }); |
89309
2286