Skip to content

Commit

Permalink
forgot to add the producer
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jun 25, 2012
1 parent 798b5c9 commit 9d57cd8
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/producer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var TapProducer = require('tap/lib/tap-producer');
var util = require('util');

module.exports = function () {
return new Producer;
};

function Producer () {
TapProducer.call(this);
}
util.inherits(Producer, TapProducer);

Producer.prototype.write = function (msg) {
if (msg && typeof msg === 'object' && msg.log) {
this.emit('data', msg.log
.split('\n')
.map(function (line) { return '>> ' + line })
.join('\n')
+ '\n'
);
}
else TapProducer.prototype.write.call(this, msg);
};

0 comments on commit 9d57cd8

Please sign in to comment.