metalsmith
Advanced tools
Comparing version 1.4.5 to 1.5.0
1.5.0 - March 29, 2015 | ||
---------------------- | ||
* add ability to pass in plugins to #run | ||
1.4.5 - March 27, 2015 | ||
@@ -3,0 +7,0 @@ ---------------------- |
@@ -39,3 +39,3 @@ | ||
assert(directory, 'You must pass a working directory path.'); | ||
this.ware = new Ware(); | ||
this.plugins = []; | ||
this.directory(directory); | ||
@@ -50,5 +50,5 @@ this.metadata({}); | ||
/** | ||
* Add a `plugin` to the middleware stack. | ||
* Add a `plugin` function to the stack. | ||
* | ||
* @param {Function or Array or Ware} plugin | ||
* @param {Function or Array} plugin | ||
* @return {Metalsmith} | ||
@@ -58,3 +58,3 @@ */ | ||
Metalsmith.prototype.use = function(plugin){ | ||
this.ware.use(plugin); | ||
this.plugins.push(plugin); | ||
return this; | ||
@@ -177,10 +177,12 @@ }; | ||
/** | ||
* Run a set of `files` through the middleware stack. | ||
* Run a set of `files` through the plugins stack. | ||
* | ||
* @param {Object} files | ||
* @param {Array} plugins | ||
* @return {Object} | ||
*/ | ||
Metalsmith.prototype.run = unyield(function*(files){ | ||
var run = thunkify(this.ware.run.bind(this.ware)); | ||
Metalsmith.prototype.run = unyield(function*(files, plugins){ | ||
var ware = new Ware(plugins || this.plugins); | ||
var run = thunkify(ware.run.bind(ware)); | ||
var res = yield run(files, this); | ||
@@ -187,0 +189,0 @@ return res[0]; |
{ | ||
"name": "metalsmith", | ||
"version": "1.4.5", | ||
"version": "1.5.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/segmentio/metalsmith.git", |
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
23127
257