<commit_before>// Dependencies ---------------------------------------------------------------
var Task = require('../lib/task/Task'),
    mustache = require('mustache');


// Template Task --------------------------------------------------------------
var template = {

    mode: Task.Each,
    data: true,

    map: function(e, file) {
        return file;
    },

    run: function(e, done) {

        var locals;
        if (typeof e.config.data === 'function') {
            locals = e.config.data(e);

        } else {
            locals = e.config.data;
        }

        done(null, mustache.render(e.data.toString(), locals));

    }

};


// Factory --------------------------------------------------------------------
module.exports = {

    task: function(pattern, data) {
        return new Task('Template', pattern, template, {
            data: data
        });
    }

};
<commit_msg>Allow for setting custom tags for mustache templates on the template task<commit_after>// Dependencies ---------------------------------------------------------------
var Task = require('../lib/task/Task'),
    mustache = require('mustache');


// Template Task --------------------------------------------------------------
var template = {

    mode: Task.Each,
    data: true,

    map: function(e, file) {
        return file;
    },

    run: function(e, done) {

        var locals;
        if (typeof e.config.data === 'function') {
            locals = e.config.data(e);

        } else {
            locals = e.config.data;
        }

        var template = mustache.compile(e.data.toString(), e.config.tags);
        done(null, template(locals));

    }

};


// Factory --------------------------------------------------------------------
module.exports = {

    task: function(pattern, data, tags) {
        return new Task('Template', pattern, template, {
            data: data,
            tags: tags || mustache.tags
        });
    }

};

{'fraction_non_alphanumeric': 0.3132036847492323, 'fraction_numerical': 0.0, 'mean_word_length': 1.1066810344827587, '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': '1602332', 'n_tokens_mistral': 492, 'n_tokens_neox': 473, 'n_words': 116}