<commit_before>/*
 * grunt-if-modified
 * https://github.com/calvinfroedge/grunt-if-modified
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

var fs          = require('fs'),
    async       = require('async'),
    taskRunner  = require('../lib/task_runner'),
    CheckSum    = require('../lib/checksum'),
    path        = require('path');

module.exports = function(grunt) {
  grunt.registerMultiTask('if_modified', 'Only execute a grunt task if a directory or the files within it have changes since the last run.', 
  function() {
    var start = new Date();
    var cs = new CheckSum(path.resolve())(this.data.dirs);

    var done = this.async();

    var toApply = function(dir, callbackOnEach){
        var ran = taskRunner(grunt, ['test_task_1']);
        callbackOnEach(null, ran);
    };

    cs.applyIfChanged(toApply, function(err, result){
        var ran = 0;<commit_msg>Added real task to taskRunner.<commit_after>/*
 * grunt-if-modified
 * https://github.com/calvinfroedge/grunt-if-modified
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

var fs          = require('fs'),
    async       = require('async'),
    taskRunner  = require('../lib/task_runner'),
    CheckSum    = require('../lib/checksum'),
    path        = require('path');

module.exports = function(grunt) {
  grunt.registerMultiTask('if_modified', 'Only execute a grunt task if a directory or the files within it have changes since the last run.', 
  function() {
    var start = new Date();
    var cs = new CheckSum(path.resolve())(this.data.dirs);
    var data = this.data;
    var done = this.async();

    var toApply = function (dir, callbackOnEach) {
        var ran = taskRunner(grunt, [data.dirs[dir]]);
        callbackOnEach(null, ran);
    };

    cs.applyIfChanged(toApply, function(err, result){
        var ran = 0;
{'fraction_non_alphanumeric': 0.14452091053467442, 'fraction_numerical': 0.005823186871360508, 'mean_word_length': 2.9622641509433962, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7018067', 'n_tokens_mistral': 597, 'n_tokens_neox': 578, 'n_words': 157}