Comparing version 0.7.2 to 0.7.3
var Q = require('q'); | ||
var debug = require('debug')('helper'); | ||
var debug = require('debug'); | ||
var http = require('http'); | ||
@@ -88,17 +88,19 @@ var https = require('https'); | ||
for (var key in map) { | ||
if (!map[key] || map[key].length === 0) { | ||
continue; | ||
} | ||
if (map.hasOwnProperty(key)) { | ||
if (!map[key] || map[key].length === 0) { | ||
continue; | ||
} | ||
filename = map[key]; | ||
if (!options.external) { | ||
filename = path.resolve(ROOT_DIR, filename); | ||
filename = map[key]; | ||
if (!options.external) { | ||
filename = path.resolve(ROOT_DIR, filename); | ||
} | ||
promises.push(loadSingle(filename) | ||
.then((function (_key) { | ||
return function (data) { | ||
loaded[_key] = data; | ||
}; | ||
})(key))); | ||
} | ||
promises.push(loadSingle(filename) | ||
.then((function (_key) { | ||
return function (data) { | ||
loaded[_key] = data; | ||
}; | ||
})(key))); | ||
} | ||
@@ -257,3 +259,12 @@ | ||
module.exports = function (inputPath) { | ||
module.exports = function (inputPath, shouldDebug) { | ||
// We can't rely on process.env anymore, so we use a passed-in `shouldDebug` | ||
// variable, and manually invoke `debug.enable()`. | ||
// This is messy because typically debug would be called with `helper` in | ||
// the require line, but after that point we lose access to `.enable()`. | ||
if (shouldDebug) { | ||
debug.enable('*'); | ||
} | ||
debug = debug('helper'); | ||
// TODO: I bet we can simply all this nonsense with a chdir() | ||
@@ -260,0 +271,0 @@ normalizePath = function (pathname) { |
var Q = require('q'); | ||
var debug = require('debug')('cleaver'); | ||
var debug = require('debug'); | ||
var path = require('path'); | ||
@@ -27,2 +27,8 @@ var marked = require('marked'); | ||
this.path = path.resolve(includePath || '.'); | ||
if (this.options.debug) { | ||
debug.enable('*'); | ||
} | ||
debug = debug('cleaver'); | ||
/** | ||
@@ -32,3 +38,3 @@ * Require helper using `this.path` as a context for where to locate any | ||
*/ | ||
helper = require('./helper')(this.path); | ||
helper = require('./helper')(this.path, this.options.debug); | ||
@@ -92,3 +98,5 @@ this.templates = { | ||
for (i in options) { | ||
this.options[i] = this.options[i] || options[i]; | ||
if (options.hasOwnProperty(i)) { | ||
this.options[i] = this.options[i] || options[i]; | ||
} | ||
} | ||
@@ -95,0 +103,0 @@ |
{ | ||
"name": "cleaver", | ||
"preferGlobal": true, | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"author": "Jordan Scales <scalesjordan@gmail.com>", | ||
@@ -22,9 +22,9 @@ "description": "30-second slideshows for hackers", | ||
"dependencies": { | ||
"mustache": "0.7.0", | ||
"q": "0.9.6", | ||
"commander": "~2.1.0", | ||
"debug": "^2.1.1", | ||
"highlight.js": "~7.3.0", | ||
"js-yaml": "2.1.0", | ||
"highlight.js": "~7.3.0", | ||
"marked": "~0.2.9", | ||
"commander": "~2.1.0", | ||
"debug": "~0.8.0" | ||
"mustache": "0.7.0", | ||
"q": "0.9.6" | ||
}, | ||
@@ -31,0 +31,0 @@ "devDependencies": { |
@@ -5,4 +5,4 @@ # Cleaver | ||
[![Travis Build](https://travis-ci.org/jdan/cleaver.png)](https://travis-ci.org/jdan/cleaver) | ||
[![NPM version](https://badge.fury.io/js/cleaver.png)](http://badge.fury.io/js/cleaver) | ||
[![Travis Build](https://travis-ci.org/jdan/cleaver.svg)](https://travis-ci.org/jdan/cleaver) | ||
[![NPM version](https://badge.fury.io/js/cleaver.svg)](http://badge.fury.io/js/cleaver) | ||
@@ -9,0 +9,0 @@ ## Intro |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1007
47504
20
+ Addeddebug@2.6.9(transitive)
+ Addedms@2.0.0(transitive)
- Removeddebug@0.8.1(transitive)
Updateddebug@^2.1.1