var Buffer = require("buffer").Buffer;
var through = require("through");

/**
 * Return a file handling function that can 
 * be piped to from within a gulp workflow
 * 
 * @return {[type]} [description]
 */
Pagemaki.prototype.stream = function () {

  var self = this;

  function write(file) {

    var stream = this;

    self.make(file._contents.toString(), function (err, made) {
      file._contents = new Buffer(made);
      stream.queue(file);
    });
    
  }

  return through(write);

};
var Pagemaki = require("pagemaki");
var Buffer = require("buffer").Buffer;
var through = require("through");

/**
 * Returns a file handling function that can 
 * be piped to from within a gulp workflow
 * 
 * @return {[type]} [description]
 */
module.exports = function (options) {

  var maker = new Pagemaki(options);

  function write(file) {

    var stream = this;

    maker.make(file._contents.toString(), function (err, made) {
      file._contents = new Buffer(made);
      stream.queue(file);
    });
    
  }

  return through(write);

};
Switch out pagemaki dependency expectation
Switch out pagemaki dependency expectation
