Skip to content

Commit

Permalink
[jshint] fixes style issues and some global leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dscape committed Dec 4, 2012
1 parent 35c10da commit 4d7db6c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/blacksmith/content.js
Expand Up @@ -34,7 +34,7 @@ exports.render = function (options, callback) {
options = { source: options };
}

var ext = path.extname(options.source)
var ext = path.extname(options.source);

if (ext !== '.md' && ext !== '.markdown') {
return callback(new Error('Invalid content extention: ' + ext));
Expand Down
4 changes: 2 additions & 2 deletions lib/blacksmith/metadata.js
Expand Up @@ -23,7 +23,7 @@ exports.render = function (metadata, references) {
return metadata;
}

var metadata = utile.clone(metadata);
metadata = utile.clone(metadata);

Object.keys(metadata).forEach(function (key) {
var plural = inflect.pluralize(key),
Expand All @@ -46,7 +46,7 @@ exports.render = function (metadata, references) {
// { author: 'Charlie Robbins' } ==> { authors: 'charlie-robbins' }
// { author: 'indexzero' } ==> { authors: 'indexzero' }
//
refname = metadata[key].toLowerCase().replace(' ', '-')
refname = metadata[key].toLowerCase().replace(' ', '-');

if (references[plural] && references[plural][refname]) {
metadata[key] = references[plural][refname];
Expand Down
4 changes: 2 additions & 2 deletions lib/blacksmith/page.js
Expand Up @@ -57,8 +57,8 @@ utile.inherits(Page, events.EventEmitter);
// Returns all fully rendered pages associated with this instance.
//
Page.prototype.renderAll = function (source, key) {
var rendered = {};
self = this
var rendered = {},
self = this;

source = source || this.content;
key = key || this.plural;
Expand Down
8 changes: 4 additions & 4 deletions lib/blacksmith/partial.js
Expand Up @@ -74,7 +74,7 @@ exports.map = function (metadata, map) {
// Always look for class="content" first.
//
map = plates.Map();
map.class('content').use('content').as('value');
map["class"]('content').use('content').as('value');
}

if (Array.isArray(metadata) && metadata[0]
Expand Down Expand Up @@ -107,14 +107,14 @@ exports.map = function (metadata, map) {
// .has(new RegExp(key + '$'))
// .replace(new RegExp(key + '$'), metadata[key]);
//console.log('map.class(%s).use(%s);', key, key);
map.class(key).use(key);
map["class"](key).use(key);
}
}
else if (keyType == 'boolean' || keyType == 'number' || keyType == 'undefined'
|| keyType == 'object') {

//console.log('map.class(%s).use(%s);', key, key)
map.class(key).use(key);
map["class"](key).use(key);

if (Array.isArray(metadata[key]) && metadata[key][0]
&& typeof metadata[key][0] === 'object') {
Expand Down Expand Up @@ -150,7 +150,7 @@ exports.remove = function (metadata, remove, map) {
remove[key].forEach(function (req) {
if (!metadata[key][req]) {
//console.log("map.class('if-' + %s).remove();", req);
map.class('if-' + req).remove();
map["class"]('if-' + req).remove();
}
});
}
Expand Down
12 changes: 6 additions & 6 deletions lib/blacksmith/site.js
Expand Up @@ -206,7 +206,7 @@ Site.prototype.render = function (callback) {
//
function writeFiles(rendered, next) {
self.writeFiles(rendered, next);
},
}
], function (err, _) {
return err ? callback(err) : callback();
});
Expand Down Expand Up @@ -249,7 +249,7 @@ Site.prototype.renderContent = function (dir, callback) {

var supporting = [],
markdown = [],
dirs = [],
dirs = [];

//
// Separate all markdown (.md, .markdown), supporting (non-markdown),
Expand Down Expand Up @@ -380,7 +380,7 @@ Site.prototype.renderContent = function (dir, callback) {
}

callback(null, rendered);
})
});
});
};

Expand All @@ -401,7 +401,7 @@ Site.prototype.writeFiles = function (rendered, callback) {
return err && err.code !== 'EEXIST'
? next(err)
: next();
}
};
}

async.series([
Expand Down Expand Up @@ -491,7 +491,7 @@ Site.prototype.targetFiles = function (rendered, pathTo) {
all = all.concat([{
fullpath: path.join.apply(path, fullpath.concat([key])),
contents: 'directory'
}])
}]);
}
else if (!rendered[key]._content.date
|| self.since < rendered[key]._content.date) {
Expand All @@ -516,7 +516,7 @@ Site.prototype.targetFiles = function (rendered, pathTo) {
return {
fullpath: path.join.apply(path, fullpath.concat([path.basename(file)])),
source: path.join(contentDir, rendered[key].dir, file)
}
};
}));
}
}
Expand Down

0 comments on commit 4d7db6c

Please sign in to comment.