<commit_before>var through = require('through-gulp');
var gutil = require('gulp-util');
var path = require('path');
var fs = require('fs');

var utils = require('./utils/utils.js');
var PLUGIN = 'gulp-release';

function publish(options) {
  return through(function(file, enc, callback) {
    if (file.isNull()) return callback(null, file);
    if (file.isStream()) return callback(new gutil.PluginError(PLUGIN, 'Streams are not supported!'));

    var blocks = utils.getSplitBlock(file.contents.toString());
    var result = utils.resolveSourceToDestiny(blocks);
    file.contents = new Buffer(result);
    if (options && options.enableResolve) {
      var fileSource = utils.getFileSource(blocks);
      utils.resolveFileSource(fileSource, options);
    }
    callback(null, file);
  }, function(callback) {
    callback();
  });
}

module.exports = publish;
<commit_msg>add default options.<commit_after>var through = require('through-gulp');
var gutil = require('gulp-util');
var path = require('path');
var fs = require('fs');

var utils = require('./utils/utils.js');
var PLUGIN = 'gulp-release';

function publish(opts) {
  var defaults = {
    enableResolve: false,
    debug: false
  };

  var options = utils.shallowMerge(opts, defaults);
  return through(function(file, enc, callback) {
    if (file.isNull()) return callback(null, file);
    if (file.isStream()) return callback(new gutil.PluginError(PLUGIN, 'Streams are not supported!'));

    var blocks = utils.getSplitBlock(file.contents.toString());
    var result = utils.resolveSourceToDestiny(blocks);
    file.contents = new Buffer(result);
    if (options && options.enableResolve) {
      var fileSource = utils.getFileSource(blocks);
      utils.resolveFileSource(fileSource, options);
    }
    callback(null, file);
  }, function(callback) {
    callback();
  });
}

module.exports = publish;

{'fraction_non_alphanumeric': 0.14866310160427806, 'fraction_numerical': 0.0, 'mean_word_length': 4.345714285714286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '429480', 'n_tokens_mistral': 560, 'n_tokens_neox': 568, 'n_words': 134}