Permalink
Browse files

upgrade benchmarx and apply cache settings

  • Loading branch information...
1 parent 6d08732 commit d698c6afb7ef519be8dd7ed7bd5b6fd2951b88ad Carlos Rodriguez committed Aug 29, 2012
Showing with 7 additions and 42 deletions.
  1. +2 −4 bench/buffet-server.js
  2. +1 −4 bench/buffet.js
  3. +1 −6 bench/ecstatic.js
  4. +0 −9 bench/lib/utils.js
  5. +1 −6 bench/node-static.js
  6. +0 −5 bench/paperboy.js
  7. +0 −5 bench/send.js
  8. +1 −2 bench/varnish.js
  9. +1 −1 package.json
View
@@ -1,13 +1,11 @@
var execFile = require('child_process').execFile
- , utils = require('./lib/utils')
+ , buffetRoot = require('path').resolve(__dirname, '..')
, buffet
-exports.name = 'buffet-server';
-exports.version = utils.version(exports.name);
+exports.version = require(buffetRoot + '/package.json').version;
exports.listen = function (options, cb) {
var port = randomPort()
- , buffetRoot = utils.resolve(__dirname, '..')
buffet = execFile(buffetRoot + '/bin/buffet.js', ['-p', port, '--no-log', '--no-watch'], {cwd: options.root});
buffet.stderr.on('data', function (chunk) {
View
@@ -1,7 +1,4 @@
-var utils = require('./lib/utils')
-
-exports.name = 'buffet';
-exports.version = utils.version(exports.name);
+exports.version = require(require('path').resolve(__dirname, '../package')).version;
exports.middleware = function (options) {
return require('../')(options.root);
View
@@ -1,8 +1,3 @@
-var utils = require('./lib/utils')
-
-exports.name = 'ecstatic';
-exports.version = utils.version(exports.name);
-
exports.middleware = function (options) {
- return require('ecstatic')(options.root);
+ return require('ecstatic')(options.root, { cache: 7200 });
};
View
@@ -1,9 +0,0 @@
-exports.resolve = require('path').resolve
-
-exports.version = function (name) {
- if (name.match(/^buffet/)) {
- return require(exports.resolve(__dirname, '../../package')).version;
- }
-
- return require(exports.resolve(__dirname, '../package')).dependencies[name];
-};
View
@@ -1,11 +1,6 @@
-var utils = require('./lib/utils')
-
-exports.name = 'node-static';
-exports.version = utils.version(exports.name);
-
exports.middleware = function (options) {
var nodeStatic = require('node-static')
- , fileServer = new(nodeStatic.Server)(options.root)
+ , fileServer = new(nodeStatic.Server)(options.root, { cache: 7200 })
return fileServer.serve.bind(fileServer);
};
View
@@ -1,8 +1,3 @@
-var utils = require('./lib/utils')
-
-exports.name = 'paperboy';
-exports.version = utils.version(exports.name);
-
exports.middleware = function (options) {
var paperboy = require('paperboy');
return function (req, res, next) {
View
@@ -1,8 +1,3 @@
-var utils = require('./lib/utils')
-
-exports.name = 'send';
-exports.version = utils.version(exports.name);
-
exports.middleware = function (options, cb) {
var send = require('send');
return function (req, res, next) {
View
@@ -1,14 +1,13 @@
var spawn = require('child_process').spawn
, execFile = require('child_process').execFile
- , utils = require('./lib/utils')
, buffet
, varnish
exports.name = 'varnish';
exports.listen = function (options, cb) {
var buffetPort = randomPort()
- , buffetRoot = utils.resolve(__dirname, '..')
+ , buffetRoot = require('path').resolve(__dirname, '..')
, port = randomPort()
buffet = execFile(buffetRoot + '/bin/buffet.js', ['-p', buffetPort], {cwd: options.root});
View
@@ -35,7 +35,7 @@
"idgen": "1.x",
"rimraf": "2.x",
"ncp": "~0.2.6",
- "benchmarx": "~0.1.0"
+ "benchmarx": "~0.2.0"
},
"optionalDependencies": {},
"engines": {

0 comments on commit d698c6a

Please sign in to comment.