<commit_before>'use strict';

var fs = require('fs'),
    path = require('path'),
    glob = require('glob'),
    _ = require('lodash'),
    console = require('winston'),
    minimatch = require("minimatch");

/**
 * WireSrc export functions to register grunt tasks
 * 
 * @param  {Object} grunt Grunt task manager instance
 * @return {[type]}       [description]
 */
function wiresrc(grunt) {

    grunt.registerMultiTask('srcInstall', 'Inject all local components in your HTML file.', function () {

        var files = {},
            sortedFiles = {},
            excludeList = [],
            appPath,
            config;

        this.requiresConfig(['srcInstall', this.target, 'src']);

        config = this.data;
        appPath = config.cwd+'/' || 'app/';

        Object.keys(config.scope).forEach(function (type) {
            // console.info(config.scope[type]);
            config.scope[type].includes.forEach(function (pattern) {
                var paths = grunt.file.expand(path.join(appPath, pattern));
                paths.forEach(function (path) {
                    var excluded;
                    if (config.scope[type].excludes) {
                        config.scope[type].excludes.forEach(function (excludePattern) {
                            // console.info(path.substr(appPath.length), "/" + excludePattern);
                            if (minimatch(path.substr(appPath.length), "/" + excludePattern)) {
                                excluded = true;
                                return;
                            }
                        });
                        if (excluded) {
                            return;
                        }
                    }
                    files[path] = path.substr(appPath.length);
                });
            });
        });

        console.info("Files ot inject : ", _.values(files));
<commit_msg>small fix to excludes path<commit_after>'use strict';

var fs = require('fs'),
    path = require('path'),
    glob = require('glob'),
    _ = require('lodash'),
    console = require('winston'),
    minimatch = require("minimatch");

/**
 * WireSrc export functions to register grunt tasks
 * 
 * @param  {Object} grunt Grunt task manager instance
 * @return {[type]}       [description]
 */
function wiresrc(grunt) {

    grunt.registerMultiTask('srcInstall', 'Inject all local components in your HTML file.', function () {

        var files = {},
            sortedFiles = {},
            excludeList = [],
            appPath,
            config;

        this.requiresConfig(['srcInstall', this.target, 'src']);

        config = this.data;
        appPath = config.cwd+'/' || 'app/';

        Object.keys(config.scope).forEach(function (type) {
            config.scope[type].includes.forEach(function (pattern) {
                var paths = grunt.file.expand(path.join(appPath, pattern));
                paths.forEach(function (path) {
                    var excluded;
                    if (config.scope[type].excludes) {
                        config.scope[type].excludes.forEach(function (excludePattern) {
                            if (minimatch(path.substr(appPath.length), excludePattern)) {
                                excluded = true;
                                return;
                            }
                        });
                        if (excluded) {
                            return;
                        }
                    }
                    files[path] = path.substr(appPath.length);
                });
            });
        });

        console.info("Files ot inject : ", _.values(files));

{'fraction_non_alphanumeric': 0.12767123287671234, 'fraction_numerical': 0.0, 'mean_word_length': 1.4652261985145172, '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': '2799784', 'n_tokens_mistral': 935, 'n_tokens_neox': 889, 'n_words': 183}