<commit_before> /*
 * grunt-exports2json
 * https://github.com/kaminaly/grunt-exports2json
 *
 * Copyright (c) 2014 kaminaly
 * Licensed under the MIT license.
 */

'use strict';
var path = require('path');
require('coffee-script/register');

module.exports = function(grunt){

  grunt.registerMultiTask('exports2json', 'exports to json', function(){
    var options = this.options({});
    var cwd = process.cwd();

    this.files.forEach(function(f){
      f.src.filter(function(filepath){
        if (!grunt.file.exists(filepath)) {
          grunt.log.warn('Source file "' + filepath + '" not found.');
          return false;
        } else {
          return true;
        }
      }).forEach(function(src){
        grunt.file.write(f.dest, JSON.stringify(require(path.join(cwd, src))));
      });
      
      grunt.log.writeln('File "' + f.dest + '" created.');
    });

  });

};<commit_msg>always delete to require cache<commit_after> /*
 * grunt-exports2json
 * https://github.com/kaminaly/grunt-exports2json
 *
 * Copyright (c) 2014 kaminaly
 * Licensed under the MIT license.
 */

'use strict';
var path = require('path');
require('coffee-script/register');

module.exports = function(grunt){

  grunt.registerMultiTask('exports2json', 'exports to json', function(){
    var options = this.options({});
    var cwd = process.cwd();

    this.files.forEach(function(f){
      f.src.filter(function(filepath){
        if (!grunt.file.exists(filepath)) {
          grunt.log.warn('Source file "' + filepath + '" not found.');
          return false;
        } else {
          return true;
        }
      }).forEach(function(src){
        src = path.join(cwd, src);
        delete require.cache[src]
        grunt.file.write(f.dest, JSON.stringify(require(src)));
      });
      
      grunt.log.writeln('File "' + f.dest + '" created.');
    });

  });

};
{'fraction_non_alphanumeric': 0.16862955032119914, 'fraction_numerical': 0.007494646680942184, 'mean_word_length': 2.7157057654075545, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6113570', 'n_tokens_mistral': 603, 'n_tokens_neox': 592, 'n_words': 112}