<commit_before>/*
 * grunt-require-cache-clear
 * https://github.com/jimbrittain/grunt-require-cache-clear
 *
 * Copyright (c) 2016 <NAME>
 * Licensed under the MIT license.
 */

'use strict';
var RequireCacheClear = require('../lib/RequireCacheClear').RequireCacheClear;
module.exports = function(grunt) {

  // Please see the Grunt documentation for more information regarding task
  // creation: http://gruntjs.com/creating-tasks

  grunt.registerMultiTask('require_cache_clear', 'Removal of files from require.cache where retention can cause issues in watch environments.', function() {
    // Merge task-specific and/or target-specific options with these defaults.
    if(require && 'cache' in require){
        //arg1 = arg1 || (this.data.files.src || undefined);
        //arg2 = arg2 || (this.data.options || undefined);
        var arg1 = this.data || undefined;
        var rcc;
        if(arg1 !== undefined){
            for(var prop in arg1){
                grunt.log.writeln(prop + ' = ' + arg1[prop]);
            }
            rcc = new RequireCacheClear(arg1);
        //var rcc = new RequireCacheClear(arg1, arg2);
        var l = rcc.run(), i, imax;
        for(i=0, imax = l.msg.length; i<imax; i+=1){ grunt.log.writeln(l.msg[i]); }
        for(i=0, imax = l.errors.msg.length; i<imax; i+=1){ grunt.log.error(l.errors.msg[i]); }
        for(i=0, imax = l.verbose.length; i<imax; i+=1){ grunt.log.verbose.writeln(l.verbose[i]); }
        for(i=0, imax = l.errors.verbose.length; i<imax; i+=1){ grunt.log.verbose.error(l.errors.verbose[i]); }
        }
    } else {
        grunt.log.error('require.cache cannot be found. Exiting with error.');
    }
    });
};<commit_msg>Updated to correct spawn related issue in with grunt<commit_after>/*
 * grunt-require-cache-clear
 * https://github.com/jimbrittain/grunt-require-cache-clear
 *
 * Copyright (c) 2019 <NAME>
 * Licensed under the MIT license.
 */
"use strict";
module.exports = function(grunt) {
  var RequireCacheClear = require('../lib/RequireCacheClear').RequireCacheClear;
  grunt.registerMultiTask('require_cache_clear', 'Removal of files from require.cache where retention can cause issues in watch environments.', function() {
        // Merge task-specific and/or target-specific options with these defaults.
        if(require && 'cache' in require){
            var files = this.data.files,
                options = this.data.options; 
            files = files || (this.files || undefined);
            options = options || (this.options || undefined);

            var rcc, i, imax, l;
            if (files !== undefined && 'src' in files) {
                for (i=0, imax = files.length; i<imax; i+=1) {
                    grunt.log.writeln('Searching require.cache for ' + files.src[i]); }}
            rcc = new RequireCacheClear(files, options);
            l = rcc.run();
            for(i=0, imax = l.msg.length; i<imax; i+=1){ grunt.log.writeln(l.msg[i]); }
            for(i=0, imax = l.errors.msg.length; i<imax; i+=1){ grunt.log.error(l.errors.msg[i]); }
            for(i=0, imax = l.verbose.length; i<imax; i+=1){ grunt.log.verbose.writeln(l.verbose[i]); }
            for(i=0, imax = l.errors.verbose.length; i<imax; i+=1){ grunt.log.verbose.error(l.errors.verbose[i]); }
        } else {
            grunt.log.error('require.cache cannot be found. Exiting with error.');
        }
    });
};
{'fraction_non_alphanumeric': 0.1564525633470831, 'fraction_numerical': 0.010901591043017089, 'mean_word_length': 2.650537634408602, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '6317488', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1086, 'n_words': 253}