<commit_before>var path = require('path');

module.exports = require('enb/lib/build-flow').create()
    .name('meta-json')
    .target('target', '?.meta.json')
    .defineOption('langs', [])
    .defineOption('examples', [])
    .builder(function () {
        var node = this.node;
        var dir = node.getDir();
        var langs = this._langs;
        var name = path.basename(dir);
        var json = {
            block: name,
            examples: this._examples
        };

        var jsdocTarget = node.unmaskTargetName('?.jsdoc.json');
        if (node.hasRegisteredTarget(jsdocTarget)) {
            json.jsdocFile = path.join(dir, jsdocTarget);
        }

        var mdFiles = [];
        var dochtmlFiles = [];

        if (langs && langs.length) {
            langs.forEach(function (lang) {
                var dochtmlTarget = node.unmaskTargetName('?.' + lang + '.doc.html');
                var mdTarget = node.unmaskTargetName('?.' + lang + '.md');

                if (node.hasRegisteredTarget(mdTarget)) {
                    mdFiles.push(path.join(dir, mdTarget));
                }

                if (node.hasRegisteredTarget(dochtmlTarget)) {
                    dochtmlFiles.push(path.join(dir, dochtmlTarget));
                }
            });
        } else {
            var dochtmlTarget = node.unmaskTargetName('?.doc.html');
            var mdTarget = node.unmaskTargetName('?.md');
<commit_msg>Fixed providing info about examples for block<commit_after>var path = require('path');

module.exports = require('enb/lib/build-flow').create()
    .name('meta-json')
    .target('target', '?.meta.json')
    .defineOption('langs', [])
    .defineOption('examples', [])
    .builder(function () {
        var node = this.node;
        var dir = node.getDir();
        var bemname = node.getPath().split(path.sep)[1];
        var langs = this._langs;
        var name = path.basename(dir);
        var json = {
            block: name,
            // Оставляем примеры только для текущего блока
            examples: this._examples.filter(function (example) {
                return example.path.split(path.sep)[1] === bemname;
            })
        };

        var jsdocTarget = node.unmaskTargetName('?.jsdoc.json');
        if (node.hasRegisteredTarget(jsdocTarget)) {
            json.jsdocFile = path.join(dir, jsdocTarget);
        }

        var mdFiles = [];
        var dochtmlFiles = [];

        if (langs && langs.length) {
            langs.forEach(function (lang) {
                var dochtmlTarget = node.unmaskTargetName('?.' + lang + '.doc.html');
                var mdTarget = node.unmaskTargetName('?.' + lang + '.md');

                if (node.hasRegisteredTarget(mdTarget)) {
                    mdFiles.push(path.join(dir, mdTarget));
                }

                if (node.hasRegisteredTarget(dochtmlTarget)) {
                    dochtmlFiles.push(path.join(dir, dochtmlTarget));
                }
            });
        } else {
            var dochtmlTarget = node.unmaskTargetName('?.doc.html');
            var mdTarget = node.unmaskTargetName('?.md');

{'fraction_non_alphanumeric': 0.14395639628085924, 'fraction_numerical': 0.0006412311638345624, 'mean_word_length': 1.8623853211009174, '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': '4588638', 'n_tokens_mistral': 930, 'n_tokens_neox': 898, 'n_words': 161}