Skip to content
Browse files

Restore the bit that actually loads the view, apparently that helps

  • Loading branch information...
1 parent 48bebe3 commit 5de794f8e882c6721f847faa2e4bd8a7d2d91195 @cjc committed Oct 2, 2010
Showing with 9 additions and 1 deletion.
  1. +8 −1 lib/quip.js
  2. +1 −0 test/test-response.js
View
9 lib/quip.js
@@ -1,4 +1,5 @@
-extname = require('path').extname;
+var extname = require('path').extname;
+var fs = require('fs');
// filter for use with Connect
var exports = module.exports = function(viewTypes){
@@ -111,6 +112,10 @@ exports.update = function(res,viewTypes){
return null;
};
+res.loadView = function(path) {
+ return fs.readFileSync(path, 'utf8');
+}
+
res.viewTypes = viewTypes;
/**
@@ -259,6 +264,8 @@ res.render = function(view, options, fn){
}
}
+ var str = res.loadView(path);
+
// Cache template engine exports
var engine = viewTypes[ext] || (viewTypes[ext] = require(ext.substr(1)));
View
1 test/test-response.js
@@ -238,6 +238,7 @@ exports.haml = function(test){
return 'success';
}}}
);
+ res.loadView = function(path){return "";};
res.send = function(data){
test.equals(data, 'success');
test.equals(res._status, 200);

0 comments on commit 5de794f

Please sign in to comment.
Something went wrong with that request. Please try again.