<commit_before>var fs = require('fs'),
    path = require('path'),
    vfs = require('enb/lib/fs/async-fs'),
    readAsset = vfs.read(path.join(__dirname, '..', 'assets', 'tmpl-spec.jst')),
    template = require('lodash').template,
    htmlDifferFilename = require.resolve('html-differ'),
    jsBeautifyFilename = require.resolve('js-beautify');

module.exports = require('enb/lib/build-flow').create()
    .name('tmpl-spec')
    .target('target', '?.tmpl-spec.js')
    .defineRequiredOption('engines')
    .defineOption('saveHtml', false)
    .useSourceFilename('references', '?.references.js')
    .useSourceListFilenames('engineTargets', [])
    .builder(function (referencesFilename) {
        var node = this.node,
            nodePath = node.getPath(),
            nodeDirname = node.getDir(),
            references = require(referencesFilename),
            engines = this._engines,
            saveHtml = this._saveHtml,
            its = [];

        Object.keys(references).forEach(function (name) {
            var bemjson = references[name].bemjson,
                html = references[name].html;

            bemjson && html && its.push(name);
        });

        return readAsset.then(function (asset) {<commit_msg>Fixed cache for `tmpl-spec` tech: should rebuild if change `saveHtml` option<commit_after>var path = require('path'),
    vfs = require('enb/lib/fs/async-fs'),
    readAsset = vfs.read(path.join(__dirname, '..', 'assets', 'tmpl-spec.jst')),
    template = require('lodash').template,
    htmlDifferFilename = require.resolve('html-differ'),
    jsBeautifyFilename = require.resolve('js-beautify');

module.exports = require('enb/lib/build-flow').create()
    .name('tmpl-spec')
    .target('target', '?.tmpl-spec.js')
    .defineRequiredOption('engines')
    .defineOption('saveHtml', false)
    .useSourceFilename('references', '?.references.js')
    .useSourceListFilenames('engineTargets', [])
    .needRebuild(function (cache) {
        return cache.get('saveHtml') !== this._saveHtml;
    })
    .saveCache(function (cache) {
        cache.set('saveHtml', this._saveHtml);
    })
    .builder(function (referencesFilename) {
        var node = this.node,
            nodePath = node.getPath(),
            nodeDirname = node.getDir(),
            references = require(referencesFilename),
            engines = this._engines,
            saveHtml = this._saveHtml,
            its = [];

        Object.keys(references).forEach(function (name) {
            var bemjson = references[name].bemjson,
                html = references[name].html;

            bemjson && html && its.push(name);
        });

        return readAsset.then(function (asset) {
{'fraction_non_alphanumeric': 0.1569356638155448, 'fraction_numerical': 0.0, 'mean_word_length': 2.794076163610719, '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': '3705457', 'n_tokens_mistral': 806, 'n_tokens_neox': 800, 'n_words': 131}