snakeskin
Advanced tools
Comparing version 5.1.1 to 5.1.2
@@ -141,2 +141,13 @@ #!/usr/bin/env node | ||
function testDir(src) { | ||
src = path.normalize(path.resolve(src)); | ||
(path.extname(src) ? path.dirname(src) : src).split(path.sep).forEach(function(el, i, data) { | ||
var src = data.slice(0, i + 1).join(path.sep); | ||
if (!exists(src)) { | ||
fs.mkdirSync(src); | ||
} | ||
}); | ||
} | ||
function action(data, file) { | ||
@@ -160,9 +171,7 @@ console.time('Time'); | ||
function pathTpl(src) { | ||
return path.normalize( | ||
src | ||
.replace(/%fileDir%/g, path.dirname(file)) | ||
.replace(/%fileName%/g, fileName) | ||
.replace(/%file%/g, path.basename(file)) | ||
.replace(/%filePath%/g, file) | ||
); | ||
return src | ||
.replace(/%fileDir%/g, path.dirname(file)) | ||
.replace(/%fileName%/g, fileName) | ||
.replace(/%file%/g, path.basename(file)) | ||
.replace(/%filePath%/g, file); | ||
} | ||
@@ -172,6 +181,8 @@ | ||
val = pathTpl(val); | ||
var tmp = val; | ||
val = path.resolve(val); | ||
val = path.normalize( | ||
path.resolve(val) | ||
); | ||
if (exists(val) && fileName && fs.statSync(val).isDirectory()) { | ||
@@ -216,20 +227,9 @@ tmp = path.join(val, fileName) + '.js'; | ||
if (outFile) { | ||
outFile = pathTpl(outFile); | ||
outFile = path.normalize(path.resolve(pathTpl(outFile))); | ||
testDir(outFile); | ||
var tmp = outFile; | ||
outFile = path.resolve(outFile); | ||
if (exists(outFile) && fs.statSync(outFile).isDirectory()) { | ||
tmp = path.join(tmp, path.basename(file)) + (program['extname'] || (execTpl ? '.html' : '.js')); | ||
outFile = path.join(outFile, path.basename(file)) + (program['extname'] || (execTpl ? '.html' : '.js')); | ||
} | ||
outFile = tmp; | ||
path.dirname(outFile).split(path.sep).forEach(function(el, i, data) { | ||
var src = data.slice(0, i + 1).join(path.sep); | ||
if (!exists(src)) { | ||
fs.mkdirSync(src); | ||
} | ||
}); | ||
if (file && (!words || exists(words)) && params.cache !== false) { | ||
@@ -311,3 +311,3 @@ var includes = Snakeskin.check(file, outFile, Snakeskin.compile(null, params, null, {cacheKey: true}), true); | ||
var tmp$0 = params.debug.files; | ||
var tmp = params.debug.files; | ||
@@ -317,5 +317,5 @@ include[file] = include[file] || {}; | ||
if (tmp$0) { | ||
for (var key in tmp$0) { | ||
if (!tmp$0.hasOwnProperty(key)) { | ||
if (tmp) { | ||
for (var key in tmp) { | ||
if (!tmp.hasOwnProperty(key)) { | ||
continue; | ||
@@ -339,10 +339,3 @@ } | ||
if (words) { | ||
path.dirname(words).split(path.sep).forEach(function(el, i, data) { | ||
var src = data.slice(0, i + 1).join(path.sep); | ||
if (!exists(src)) { | ||
fs.mkdirSync(src); | ||
} | ||
}); | ||
testDir(words); | ||
fs.writeFileSync(words, JSON.stringify(params.words, null, '\t')); | ||
@@ -349,0 +342,0 @@ } |
{ | ||
"name": "Snakeskin", | ||
"main": "build/snakeskin.min.js", | ||
"version": "5.1.1", | ||
"version": "5.1.2", | ||
"homepage": "https://github.com/kobezzza/Snakeskin", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
/*! | ||
* Snakeskin v5.1.1 (live) | ||
* Snakeskin v5.1.2 (live) | ||
* https://github.com/kobezzza/Snakeskin | ||
@@ -8,3 +8,3 @@ * | ||
* | ||
* Date: Thu, 02 Oct 2014 10:38:58 GMT | ||
* Date: Fri, 03 Oct 2014 09:39:14 GMT | ||
*/ | ||
@@ -37,3 +37,3 @@ | ||
*/ | ||
VERSION: [5, 1, 1], | ||
VERSION: [5, 1, 2], | ||
@@ -40,0 +40,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
/*! Snakeskin v5.1.1 (live) | https://github.com/kobezzza/Snakeskin/blob/master/LICENSE */Array.isArray=Array.isArray||function(k){return"[object Array]"==={}.toString.call(k)};String.prototype.trim=String.prototype.trim||function(){for(var k=this.replace(/^\s\s*/,""),l=k.length,m=/\s/;m.test(k.charAt(--l)););return k.substring(0,l+1)};var e={VERSION:[5,1,1],a:{},Filters:{},Vars:{},LocalVars:{},cache:{}}; | ||
/*! Snakeskin v5.1.2 (live) | https://github.com/kobezzza/Snakeskin/blob/master/LICENSE */Array.isArray=Array.isArray||function(k){return"[object Array]"==={}.toString.call(k)};String.prototype.trim=String.prototype.trim||function(){for(var k=this.replace(/^\s\s*/,""),l=k.length,m=/\s/;m.test(k.charAt(--l)););return k.substring(0,l+1)};var e={VERSION:[5,1,2],a:{},Filters:{},Vars:{},LocalVars:{},cache:{}}; | ||
(function(){function k(a){return m[a]}var l="undefined"===typeof window&&"undefined"!==typeof exports;e.importFilters=function(a,f){var c=e.Filters;if(f)for(var d=f.split("."),g=-1;++g<d.length;)c[d[g]]||(c[d[g]]={}),c=c[d[g]];for(var h in a)a.hasOwnProperty(h)&&(c[h]=a[h])};var m={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},p=/[&<>"'\/]/g,q=/([$\w]\s*=\s*)([^"'\s>=]+)/g,r=/(javascript)(:|;)/;e.Filters.html=function(a,f){var c=a+"";f&&(c=c.replace(q,'$1"$2"'));c=c.replace(p, | ||
@@ -3,0 +3,0 @@ k);f&&(c=c.replace(r,"$1$2"));return c};e.Filters.undef=function(a){return void 0!==a?a:""};(function(){function a(b){return f[b]}var f={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"},c=/&|<|>|"|'|//g;e.Filters.uhtml=function(b){return(b+"").replace(c,a)};var d=/<\/?[^>]+>/g;e.Filters.stripTags=function(b){return(b+"").replace(d,"")};var g=/%5B/g,h=/%5D/g;e.Filters.uri=function(b){return encodeURI(b+"").replace(g,"[").replace(h,"]")};e.Filters.upper= |
@@ -0,1 +1,5 @@ | ||
## v5.1.2 | ||
- [x] Исправления мелких ошибок. | ||
## v5.1.1 | ||
@@ -2,0 +6,0 @@ |
@@ -11,3 +11,3 @@ //#include ./es5shim.live.js | ||
*/ | ||
VERSION: [5, 1, 1], | ||
VERSION: [5, 1, 2], | ||
@@ -14,0 +14,0 @@ /** |
@@ -29,5 +29,9 @@ (function() { | ||
if (opt_base) { | ||
val = path['normalize'](path['resolve'](path['dirname'](opt_base), val)); | ||
val = path['join'](path['dirname'](opt_base), val); | ||
} | ||
val = path['normalize']( | ||
path['resolve'](path['dirname'](opt_base), val) | ||
); | ||
if (exists(val)) { | ||
@@ -34,0 +38,0 @@ if (opt_onFileExists) { |
{ | ||
"name": "snakeskin", | ||
"version": "5.1.1", | ||
"version": "5.1.2", | ||
"main": "snakeskin.js", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -26,2 +26,5 @@ module.exports = exports = require('./build/snakeskin.min'); | ||
exports.check = function (source, result, opt_key, opt_includes) { | ||
source = path.normalize(path.resolve(source)); | ||
result = path.normalize(path.resolve(result)); | ||
if (!exists(source) || !exists(result)) { | ||
@@ -28,0 +31,0 @@ return false; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1259379
24879
50