Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

renamed getContents to getContentPaths

  • Loading branch information...
commit 2b4051a81ac7645f9e456026281f81e68e377ee7 1 parent f2ea8ff
Lakshan Perera authored
4 lib/content_handler.js
View
@@ -249,8 +249,8 @@ module.exports = {
return traverse_path();
},
- // returns all available contents for a given path
- getContents: function(basepath, callback) {
+ // returns all available content paths under a given section path
+ getContentPaths: function(basepath, callback) {
var self = this;
var collected_contents = [];
3  lib/site_generator.js
View
@@ -107,7 +107,7 @@ module.exports = {
collectPathsForSection: function(section, callback) {
var self = this;
- self.contents.getContents(section, function(err, content_paths){
+ self.contents.getContentPaths(section, function(err, content_paths){
self.getStaticAndCompilableTemplates(section, function(err, template_paths){
return callback(null, _.union(content_paths, template_paths));
});
@@ -182,6 +182,7 @@ module.exports = {
renderEachPath: function(paths, callback) {
var self = this;
+ console.log(paths);
var move_to_next_path = function() {
if (paths.length) {
8 spec/content_handler.spec.js
View
@@ -381,7 +381,7 @@ describe("get sections", function(){
});
-describe("get contents", function(){
+describe("get content paths", function(){
it("collect all content files (except shared file)", function(){
spyOn(fs, "readdir").andCallFake(function(path, callback){
@@ -389,7 +389,7 @@ describe("get contents", function(){
});
var spyCallback = jasmine.createSpy();
- default_handler.getContents("path/test", spyCallback);
+ default_handler.getContentPaths("path/test", spyCallback);
expect(spyCallback).toHaveBeenCalledWith(null, ["path/test/index", "path/test/page1", "path/test/page2"]);
});
@@ -400,7 +400,7 @@ describe("get contents", function(){
});
var spyCallback = jasmine.createSpy();
- default_handler.getContents("path/test", spyCallback);
+ default_handler.getContentPaths("path/test", spyCallback);
expect(spyCallback).toHaveBeenCalledWith(null, ["path/test/index", "path/test/another_page"]);
@@ -412,7 +412,7 @@ describe("get contents", function(){
});
var spyCallback = jasmine.createSpy();
- default_handler.getContents("path/not_exist", spyCallback);
+ default_handler.getContentPaths("path/not_exist", spyCallback);
expect(spyCallback).toHaveBeenCalledWith("error", []);
});
6 spec/site_generator.spec.js
View
@@ -392,7 +392,7 @@ describe("collect paths for section", function() {
it("collect content paths for the section", function() {
var spyGetContents = jasmine.createSpy();
- site_generator.contents = { "getContents": spyGetContents };
+ site_generator.contents = { "getContentPaths": spyGetContents };
var spyCallback = jasmine.createSpy();
site_generator.collectPathsForSection("path/test", spyCallback);
@@ -405,7 +405,7 @@ describe("collect paths for section", function() {
spyGetContents.andCallFake(function(section, callback){
return callback(null, []);
});
- site_generator.contents = { "getContents": spyGetContents };
+ site_generator.contents = { "getContentPaths": spyGetContents };
spyOn(site_generator, "getStaticAndCompilableTemplates");
@@ -420,7 +420,7 @@ describe("collect paths for section", function() {
spyGetContents.andCallFake(function(section, callback){
return callback(null, ["path/test/page1", "path/test/page2"]);
});
- site_generator.contents = { "getContents": spyGetContents };
+ site_generator.contents = { "getContentPaths": spyGetContents };
spyOn(site_generator, "getStaticAndCompilableTemplates").andCallFake(function(section, callback){
return callback(null, ["path/test/image.jpg", "path/test/styles.css"]);
Please sign in to comment.
Something went wrong with that request. Please try again.