diff --git a/lib/Statistics.js b/lib/Statistics.js index 305e4d8..9b0103c 100644 --- a/lib/Statistics.js +++ b/lib/Statistics.js @@ -1,5 +1,3 @@ -var di = require('di'); - function Statistics() { //Taken from z-table where confidence is 95% this.criticalValue = 1.96 @@ -38,5 +36,4 @@ Statistics.prototype.calculateStandardDeviation = function(sample, mean) { return deviation; }; -// di.annotate(Statistics, new di.Inject()) module.exports = Statistics; diff --git a/lib/cli.js b/lib/cli.js index af1100f..20b5acf 100755 --- a/lib/cli.js +++ b/lib/cli.js @@ -114,12 +114,18 @@ exports.build = function build(options, done) { fs.writeFileSync(path.resolve(buildPath, benchmark, 'index-auto.html'), autoMain); createBenchmarkListingPage(buildPath, benchmarks); - browserify(path.resolve(benchpressBase , './lib/bp'), {baseDir: './lib/'}).bundle(). - pipe(fs.createWriteStream(path.resolve(buildPath, benchmark, 'bp.js'))). - on('close', isDone); - browserify(path.resolve(benchpressBase, './lib/auto-bp'), {baseDir: './lib/'}).bundle(). - pipe(fs.createWriteStream(path.resolve(buildPath, benchmark, 'auto-bp.js'))). - on('close', isDone); + ['auto-bp','bp'].forEach(function(dest) { + var bpOut = ''; + browserify(path.resolve(benchpressBase , './lib/', dest), {baseDir: './lib/'}).bundle().on('data', function(chunk) { + bpOut += chunk.toString(); + }).on('end', function() { + bpOut = bpOut.replace(/\$traceurRuntime/g, '$diTraceurRuntime'); + bpOut = bpOut.replace(/System/g, 'DITraceurSystem'); + fs.writeFileSync(path.resolve(buildPath, benchmark, dest+'.js'), bpOut); + isDone(); + }); + }); + fs.createReadStream(underscorePath). pipe(fs.createWriteStream(path.resolve(buildPath, benchmark, 'underscore-min.js'))). on('close', isDone);