punch
Advanced tools
Comparing version 0.0.2-beta to 0.0.3-beta
@@ -62,3 +62,6 @@ var fs = require("fs"); | ||
files.forEach(function(file){ | ||
// ignore hidden files and files without extensions | ||
var content_files = files.filter(function(file){ return file.indexOf(".") > 0}) | ||
content_files.forEach(function(file){ | ||
@@ -65,0 +68,0 @@ fs.readFile(path + "/" + file, function (err, data) { |
@@ -5,3 +5,3 @@ { | ||
, "keywords": ["static", "sites", "mustache", "json", "markdown"] | ||
, "version": "0.0.2-beta" | ||
, "version": "0.0.3-beta" | ||
, "homepage": "https://github.com/laktek/punch" | ||
@@ -8,0 +8,0 @@ , "author": "Lakshan Perera <lakshan@web2media.net> (http://laktek.com)" |
# Punch | ||
### Easy way to generate static sites with Mustache templates & JSON | ||
### An easy way to generate static sites with Mustache templates & JSON | ||
@@ -4,0 +4,0 @@ NOTE: I will update the README with more elaborative details and examples. |
@@ -652,3 +652,3 @@ var util = require("util"); | ||
spyOn(fs, 'readdir').andCallFake(function(path, callback){ | ||
callback(null, ["test.mustache"]); | ||
callback(null, ["test.markdown"]); | ||
}); | ||
@@ -677,2 +677,17 @@ | ||
it("ignores hidden files", function(){ | ||
var output = null; | ||
spyOn(fs, 'readdir').andCallFake(function(path, callback){ | ||
callback(null, ["test.markdown", ".hidden"]); | ||
}); | ||
spyOn(fs, 'readFile'); | ||
punch.fetchContentFromDir("contents/simple", function(){}); | ||
expect(fs.readFile.callCount).toEqual(1); | ||
}); | ||
it("on an error, pass the error in the callback", function(){ | ||
@@ -679,0 +694,0 @@ |
38985
925