Comparing version 0.8.6 to 0.8.7
@@ -7,6 +7,6 @@ /** | ||
* http://github.com/zhiyu/icecream | ||
* | ||
* | ||
*/ | ||
var utils = require('./utils'); | ||
@@ -25,3 +25,3 @@ var fs = require('fs'); | ||
prototype.render = function(){ | ||
prototype.render = function(){ | ||
@@ -31,4 +31,8 @@ var self = this; | ||
var debug = this.context.get("debug"); | ||
var file, options; | ||
var file; | ||
var options = { | ||
title:'' | ||
} | ||
if(arguments.length > 1 || (arguments.length == 1 && typeof arguments[0] == 'string')){ | ||
@@ -41,7 +45,5 @@ file = arguments[0]; | ||
if(arguments.length > 1){ | ||
options = arguments[1]; | ||
}else if(arguments.length == 0 || (arguments.length == 1 && typeof arguments[0] == 'string')){ | ||
options = {}; | ||
}else{ | ||
options = arguments[0]; | ||
utils.merge(arguments[1], options); | ||
}else if(arguments.length == 1 && typeof arguments[0] != 'string'){ | ||
utils.merge(arguments[0], options); | ||
} | ||
@@ -64,14 +66,14 @@ | ||
self.send(content); | ||
if(self.context.get("static")){ | ||
var stc = self.context.getObject("statics", self.req.url); | ||
var stc = self.context.getObject("statics", self.req.url); | ||
var file = self.context.get('staticDir')+stc; | ||
if(stc){ | ||
fs.writeFile(file, content, function (err) { | ||
console.log(err); | ||
console.log(err); | ||
}); | ||
} | ||
} | ||
} | ||
@@ -81,3 +83,3 @@ | ||
var engine = this.context.engines[ext]; | ||
file += '.' + ext; | ||
@@ -88,3 +90,3 @@ if(file.indexOf('/')==0) | ||
file = this.context.get('appDir')+'/views'+this.viewDir+'/'+file; | ||
//render body | ||
@@ -99,3 +101,3 @@ engine(file, options, callbackForPage); | ||
prototype.error = function(errorCode){ | ||
prototype.error = function(errorCode){ | ||
var self = this; | ||
@@ -167,3 +169,3 @@ var body; | ||
} | ||
data['flash_time'] = time; | ||
@@ -207,3 +209,3 @@ | ||
} | ||
if(val!==undefined){ | ||
@@ -227,2 +229,2 @@ this.req.session[key] = val; | ||
this.afterFilter = func; | ||
} | ||
} |
@@ -53,3 +53,3 @@ { | ||
}, | ||
"version": "0.8.6" | ||
"version": "0.8.7" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17703
728038