<commit_before>/**
 * Created by ElyDeLaCruz on 11/18/2014.
 */
require('sjljs');

// Import base task proxy to extend
var TaskProxy = require('../TaskProxy'),
    chalk = require('chalk'),
    path = require('path');

module.exports = TaskProxy.extend("DeployProxy", {

    registerGulpTask: function (taskName, targets, gulp, wrangler, tasks) {
        var tasks,
            watchInterval = null;

        gulp.task(taskName, function () {

            console.log('\nWatching for changes...');

            gulp.watch(targets, function (event) {

                var doneTaskCount = 0,
                    fileShortPath = event.path;
                //
                //if (Array.isArray(targets) && targets.length > 0) {
                //    fileShortPath = targets.filter(function (file) {
                //        //console.log(file, '\n');
                //        file = file.indexOf('./') === 0 ? file.substr(1, file.length) : file;
                //        //console.log(file, '\n');
                //        return (fileShortPath.replace(/\\/, '/')).indexOf(file) > -1;
                //    })[0];
                //}
                //else if (sjl.classOfIs(targets, 'String')) {
                //    fileShortPath = targets;
                //}


                console.log(targets, '\n', 'File change detected at ' + fileShortPath + ';  Change type: ' + event.type + ';', 'Running tasks...');

                wrangler.launchTasks(tasks, gulp);

                if (watchInterval !== null) {
                    clearInterval(watchInterval);
                }

                watchInterval = setInterval(function () {
                    var taskKeys = Object.keys(gulp.tasks);
                    taskKeys.forEach(function (key) {
                        if (gulp.tasks[key].done === true) {
                            doneTaskCount += 1;
                        }
                    });
                    if (doneTaskCount === taskKeys.length) {
                        console.log(chalk.cyan('\nBuild and Deploy completed.') + chalk.dim('\nNow watching for more changes...'));
                        clearInterval(watchInterval);
                    }
                }, 10);
<commit_msg>Fixed  tasks completion messaging.<commit_after>/**
 * Created by ElyDeLaCruz on 11/18/2014.
 */
require('sjljs');

// Import base task proxy to extend
var TaskProxy = require('../TaskProxy'),
    chalk = require('chalk'),
    path = require('path');

module.exports = TaskProxy.extend("DeployProxy", {

    registerGulpTask: function (taskName, targets, gulp, wrangler, tasks) {
        var tasks,
            watchInterval = null;

        gulp.task(taskName, function () {

            console.log('\nWatching for changes...');

            gulp.watch(targets, function (event) {

                var doneTaskCount = 0,
                    fileShortPath = event.path;
                //
                //if (Array.isArray(targets) && targets.length > 0) {
                //    fileShortPath = targets.filter(function (file) {
                //        //console.log(file, '\n');
                //        file = file.indexOf('./') === 0 ? file.substr(1, file.length) : file;
                //        //console.log(file, '\n');
                //        return (fileShortPath.replace(/\\/, '/')).indexOf(file) > -1;
                //    })[0];
                //}
                //else if (sjl.classOfIs(targets, 'String')) {
                //    fileShortPath = targets;
                //}


                console.log('\n', 'File change detected at ' + fileShortPath + ';  Change type: ' + event.type + ';', 'Running tasks...', '\n');

                wrangler.launchTasks(tasks, gulp);

                if (watchInterval !== null) {
                    clearInterval(watchInterval);
                }

                watchInterval = setInterval(function () {
                    var taskKeys = Object.keys(gulp.tasks);
                    taskKeys.forEach(function (key) {
                        if (gulp.tasks[key].done === true) {
                            doneTaskCount += 1;
                        }
                    });
                    if (doneTaskCount === taskKeys.length - 1) {
                        console.log(chalk.cyan('\nBuild and Deploy completed.') + chalk.dim('\nNow watching for more changes...'));
                        clearInterval(watchInterval);
                    }
                }, 10);

{'fraction_non_alphanumeric': 0.14224910394265233, 'fraction_numerical': 0.007840501792114695, 'mean_word_length': 1.3231009365244537, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5548111', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1131, 'n_words': 240}