Browse files

removed logging and deleted some unused code

  • Loading branch information...
1 parent 7dadafe commit 0fc08c03d4227c8f86fb10646372d29a14cda56f @shanebo committed Mar 16, 2012
View
2 lib/calvin/calvin.js
@@ -72,7 +72,7 @@ var Calvin = new Class({
var stack = this.stack;
request.calvin = {};
request.started = new Date;
- request.on('end', this.logger.bind(this, request, response));
+// request.on('end', this.logger.bind(this, request, response));
var nextFn = function(index){
var ware = stack[index + 1];
View
8 lib/calvin/controller.js
@@ -60,10 +60,10 @@ var Controller = new Class({
},
render: function(view, layout, data){
- this.request.calvin.view = view;
- this.request.calvin.layout = layout;
- this.request.calvin.engine = this.engine;
- this.request.calvin.dump = data;
+// this.request.calvin.view = view;
+// this.request.calvin.layout = layout;
+// this.request.calvin.engine = this.engine;
+// this.request.calvin.dump = data;
view = Object.clone(this.cache['/views' + view]);
view.body = this.engines[this.engine](view.body, data);
View
15 lib/calvin/middleware/assets.js
@@ -118,25 +118,10 @@ var Assets = new Class({
serve: function(request, response, asset){
if (request.headers['if-none-match'] && (request.headers['if-none-match'] == asset.headers['ETag'])) {
response.writeHead(304, asset.headers);
-// response.statusCode(304);
response.end();
return;
}
-// if (request.headers['if-modified-since']) {
-//
-// console.log('request.headers["if-modified-since"] ' + request.headers['if-modified-since']);
-//
-// var modified_since = new Date(request.headers['if-modified-since']);
-// var last_modified = new Date(asset['Last-Modified']);
-//
-// if (last_modified >= modified_since) {
-// response.statusCode(304);
-// response.end();
-// return;
-// }
-// }
-
// 'Accept-Encoding': 'compress, gzip',
asset.headers['Date'] = new Date().toUTCString();
response.writeHead(200, asset.headers);
View
4 lib/calvin/middleware/router.js
@@ -78,8 +78,8 @@ var Router = new Class({
}
}
- request.calvin.route = routeObj;
- request.calvin.matches = matches;
+// request.calvin.route = routeObj;
+// request.calvin.matches = matches;
var controller = new this.controllers[routeObj.controller](request, response, this.options);
controller[routeObj.action].pass(matches, controller)();
View
10 lib/calvin/middleware/sessions.js
@@ -51,7 +51,7 @@ var Sessions = new Class({
response.session = this.get(id) || {};
request.session = response.session;
request.on('end', function(event, data){
- console.log('\nRequest ended');
+// console.log('\nRequest ended');
this.update(response._session.id, request.session);
}.bind(this));
@@ -60,18 +60,18 @@ var Sessions = new Class({
},
get: function(id){
- console.log('\nGet session');
+// console.log('\nGet session');
return this.store[id];
},
update: function(id, data){
- console.log('\nUpdating session');
+// console.log('\nUpdating session');
this.store[id] = data;
- console.log(this.store);
+// console.log(this.store);
},
destroy: function(id, request, response){
- console.log('\nDestroying session');
+// console.log('\nDestroying session');
delete this.store[id];
}

0 comments on commit 0fc08c0

Please sign in to comment.