Comparing version 0.2.1 to 0.2.2
@@ -113,5 +113,5 @@ var path = require('path'); | ||
controller.controllerName = controllerName; | ||
controller.viewDir = path.dirname(relName) + controllerName; | ||
controller.viewDir = path.dirname(relName) + "/" + controllerName; | ||
var content = fs.readFileSync(absName).toString(); | ||
new Function('context', 'require','with(context){'+ content + '}')(controller); | ||
new Function('context', 'require','with(context){'+ content + '}')(controller,require); | ||
this.context.setObject("controllers", absName, controller); | ||
@@ -130,5 +130,5 @@ }else{ | ||
}else if(url.lastIndexOf("/") == (url.length-1)){ | ||
name = url.substr(0,url.length-1).substr(url.lastIndexOf("/")); | ||
name = url.substr(0,url.length-1); | ||
}else{ | ||
name = url.substr(url.lastIndexOf("/")); | ||
name = url.substr(0,url.lastIndexOf("/")); | ||
} | ||
@@ -164,3 +164,3 @@ return path.basename(name); | ||
prototype.isDefaultController = function(url){ | ||
return url == '/' || path.dirname(url) == '/'; | ||
return url.lastIndexOf('/')==0; | ||
} | ||
@@ -167,0 +167,0 @@ |
@@ -5,3 +5,3 @@ var Language = module.exports = {} | ||
var languages = {}; | ||
if(session["lang"]){ | ||
if(session && session["lang"]){ | ||
languages = icecream.getObject("languages", session["lang"]); | ||
@@ -8,0 +8,0 @@ }else{ |
{ | ||
"name": "icecream", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "rapid web framework for nodejs", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/nodengine/icecream", |
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
28756