templatizer
Advanced tools
Comparing version 0.2.7 to 0.2.8
{ | ||
"name": "templatizer", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -20,2 +20,3 @@ var jade = require('jade'); | ||
var pathSep = path.sep || (isWindows ? '\\' : '/'); | ||
var pathSepRegExp = /\/|\\/g; | ||
var placesToLook = [ | ||
@@ -39,2 +40,3 @@ __dirname + '/../jade/runtime.min.js', | ||
var contents = walkdir.sync(templateDirectory); | ||
templateDirectory = templateDirectory.replace(pathSepRegExp, pathSep); | ||
@@ -48,3 +50,3 @@ contents.forEach(function (file) { | ||
if (_readTemplates.indexOf(item) > -1) { | ||
throw new Error(item + ' from ' + templateDirectory + '/' + item + ' already exists in ' + templates[_readTemplates.indexOf(item)]); | ||
throw new Error(item + ' from ' + templateDirectory + pathSep + item + ' already exists in ' + templates[_readTemplates.indexOf(item)]); | ||
} | ||
@@ -77,5 +79,4 @@ | ||
if (dirname === '.') return name; | ||
var arr = dirname.split(pathSep); | ||
arr.push(name); | ||
return _.compact(arr).join('.'); | ||
dirname += '.' + name; | ||
return dirname.substring(1).replace(pathSepRegExp, '.'); | ||
}(); | ||
@@ -103,3 +104,3 @@ var mixinOutput = ''; | ||
'', | ||
'// ' + dirString.replace(/\./g, '/') + '.jade compiled template', | ||
'// ' + dirString.replace(/\./g, pathSep) + '.jade compiled template', | ||
parentObjName + '["' + dirString.replace(/\./g, '"]["') + '"] = ' + template + ';', | ||
@@ -106,0 +107,0 @@ '' |
134097
3647