<commit_before>/*
 * grunt-qettlhup
 * https://github.com/theablefew/qettlhup
 *
 * Copyright (c) 2013 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

  function spawn(src, task, i, callback) {
    var quD = grunt.util.spawn(task,
      function(error, result, code) {
        i++;
        if (error)
          callback(error);
        else
          callback(i);
    });

    quD.stdin.write(new Buffer(src));
    quD.stdin.end();
    quD.stdout.pipe(process.stdout);
    quD.stderr.pipe(process.stderr);
  }

  grunt.registerMultiTask('qettlhup', 'Test Browsers in Sauce Labs', function() {
    // Merge task-specific and/or target-specific options with these defaults.
    var browserArray,
        command,
        spawnReturn,
        loadArray,
        qettlhup = this.data,
        json = qettlhup.json;

    command = function(i) {
      return {
        cmd: qettlhup.test.lang,
        args: [qettlhup.test.path, browserArray[i]]
      };
    };

    spawnReturn = function(i){
      console.log(i);
      console.log(browserArray.length);
      if(typeof i === "number") {
        if(i < browserArray.length)
          spawn(src, command(i), i, spawnReturn);
        else
          grunt.log.ok('All Browser Tests Completed');
      } else {
        grunt.log.error(i);<commit_msg>removing console.logs<commit_after>/*
 * grunt-qettlhup
 * https://github.com/theablefew/qettlhup
 *
 * Copyright (c) 2013 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

  function spawn(src, task, i, callback) {
    var quD = grunt.util.spawn(task,
      function(error, result, code) {
        i++;
        if (error)
          callback(error);
        else
          callback(i);
    });

    quD.stdin.write(new Buffer(src));
    quD.stdin.end();
    quD.stdout.pipe(process.stdout);
    quD.stderr.pipe(process.stderr);
  }

  grunt.registerMultiTask('qettlhup', 'Test Browsers in Sauce Labs', function() {
    // Merge task-specific and/or target-specific options with these defaults.
    var browserArray,
        command,
        spawnReturn,
        loadArray,
        qettlhup = this.data,
        json = qettlhup.json;

    command = function(i) {
      return {
        cmd: qettlhup.test.lang,
        args: [qettlhup.test.path, browserArray[i]]
      };
    };

    spawnReturn = function(i){
      if(typeof i === "number") {
        if(i < browserArray.length)
          spawn(src, command(i), i, spawnReturn);
        else
          grunt.log.ok('All Browser Tests Completed');
      } else {
        grunt.log.error(i);
{'fraction_non_alphanumeric': 0.13536121673003804, 'fraction_numerical': 0.003041825095057034, 'mean_word_length': 2.2723880597014925, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3902210', 'n_tokens_mistral': 894, 'n_tokens_neox': 873, 'n_words': 178}