<commit_before>var es = require('event-stream');
var gutil = require('gulp-util');
var path = require('path');
var ect = require('ect');

module.exports = function (opt) {
  opt = opt || {};
  if (!opt.ext) opt.ext = '.ect';
  if (!opt.outExt) opt.outExt = '.html';

  return es.map(function (file, callback) {
    try {
      var filePath = file.base;
      var fileName = gutil.replaceExtension(path.basename(file.path), "");
      var html = ect({
        root: filePath,
        ext: opt.ext
      });
      html.render(fileName, function (error, html) {
        file.contents = new Buffer(html);
        file.path = gutil.replaceExtension(file.path, opt.outExt);
      });
    } catch (e) {
      console.warn('Error gulp-ect: ' + e.message);
    }
    callback(null, file);
  });
};<commit_msg>Use gulp-util.log instead of console.warn<commit_after>var es = require('event-stream');
var gutil = require('gulp-util');
var path = require('path');
var ect = require('ect');

module.exports = function (opt) {
  opt = opt || {};
  if (!opt.ext) opt.ext = '.ect';
  if (!opt.outExt) opt.outExt = '.html';

  return es.map(function (file, callback) {
    try {
      var filePath = file.base;
      var fileName = gutil.replaceExtension(path.basename(file.path), "");
      var html = ect({
        root: filePath,
        ext: opt.ext
      });
      html.render(fileName, function (error, html) {
        file.contents = new Buffer(html);
        file.path = gutil.replaceExtension(file.path, opt.outExt);
      });
    } catch (e) {
      gutil.log(gutil.colors.red('Error gulp-ect: ' + e.message));
    }
    callback(null, file);
  });
};
{'fraction_non_alphanumeric': 0.1746804625684723, 'fraction_numerical': 0.0, 'mean_word_length': 2.7534246575342465, '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': '5020002', 'n_tokens_mistral': 546, 'n_tokens_neox': 545, 'n_words': 124}