<commit_before>var atomifyJs = require('atomify-js')
  , atomifyCss = require('atomify-css')
  , path = require('path')
  , fs = require('fs')
  , mochaCode = fs.readFileSync(require.resolve('mocha/mocha.js'))
  , mochaStyle = fs.readFileSync(require.resolve('mocha/mocha.css'));

module.exports = function(grunt) {
    var browsers = [{
          browserName: 'firefox'
        , version: '26'
        , platform: 'Windows 8.1'
        }
      , {
          browserName: 'chrome'
        , platform: 'Windows 8.1'
        }
      , {
          browserName: 'chrome'
        , platform: 'Windows 8.1'
        }
      , {
          browserName: 'internet explorer'
        , platform: 'Windows 8.1'
        , version: '10'
        }
      , {
          browserName: 'internet explorer'
        , platform: 'WIN7'
        , version: '9'
        }
      , {
          browserName: 'iphone'
        , platform: 'OS X 10.9'
        , version: '7'
        , 'device-orientation': 'portrait'
        }
      , {
          browserName: 'ipad'
        , platform: 'OS X 10.9'
        , version: '6'
        , 'device-orientation': 'portrait'
        }
      , {
          browserName: 'android'
        , platform: 'Linux'
        , version: '4.0'
        , 'device-orientation': 'portrait'
        }
      , {
          browserName: 'android'
        , platform: 'Linux'
        , version: '4.0'
        , 'device-type': 'tablet'
        , 'device-orientation': 'portrait'
        }];

    grunt.initConfig({
        connect: {
            server: {
                options: {
                    base: 'test',
                    port: 9999
                }
            }
        },
        'saucelabs-mocha': {
            all: {
                options: {
                    urls: ['http://127.0.0.1:9999'],
                    tunnelTimeout: 5,
                    build: process.env.TRAVIS_JOB_ID,
                    concurrency: 3,
                    browsers: browsers,
                    testname: 'ribcage-view',
                    tags: ['master']
                }
            }
        },
        watch: {
          scripts: {
            files: ['extend.js', 'Gruntfile.js', 'test/entry.js', 'test/fixtures/*.js']
          , tasks: ['atomifyJs', 'atomifyCss']
          , options: {
              interrupt: true
            }
          }
        }
    });

    // Loading dependencies
    for (var key in grunt.file.readJSON('package.json').devDependencies) {
        if (key !== 'grunt' && key.indexOf('grunt') === 0) grunt.loadNpmTasks(key);
    }

    grunt.registerTask('atomifyJs', 'Atomify the js', function () {
      var done = this.async()
        , outputFile = path.join(__dirname, 'test', 'bundle.js');

      atomifyJs({
        entry: path.join(__dirname, 'test', 'entry.js')
      , debug: false
      }, function (err, src) {
        if(err) {
          console.trace(err);
          return done(false);
        }

        // Prepend mocha's browser distributable
        src = mochaCode + ';' + src.toString();

        fs.writeFile(outputFile, src, function (err) {
          if(err) {
            console.trace(err);
            return done(false);
          }

          done();
        });
      });
    });

    grunt.registerTask('atomifyCss', 'Atomify the css', function () {
      var done = this.async()
        , outputFile = path.join(__dirname, 'test', 'bundle.css');

      atomifyCss({
        entry: path.join(__dirname, 'test', 'entry.css')
      }, function (err, src) {
        if(err) {
          console.trace(err);
          return done(false);
        }

        src = mochaStyle + ';' + src.toString();

        fs.writeFile(outputFile, src, function (err) {
          if(err) {
            console.trace(err);
            return done(false);
          }

          done();
        });
      });
    });

    grunt.registerTask('dev', ['connect', 'atomifyJs', 'atomifyCss', 'watch']);
    grunt.registerTask('test', ['connect', 'saucelabs-mocha']);
};
<commit_msg>Fix minor bug in test runner where css concat would be broken<commit_after>var atomifyJs = require('atomify-js')
  , atomifyCss = require('atomify-css')
  , path = require('path')
  , fs = require('fs')
  , mochaCode = fs.readFileSync(require.resolve('mocha/mocha.js'))
  , mochaStyle = fs.readFileSync(require.resolve('mocha/mocha.css'));

module.exports = function(grunt) {
    var browsers = [{
          browserName: 'firefox'
        , version: '26'
        , platform: 'Windows 8.1'
        }
      , {
          browserName: 'chrome'
        , platform: 'Windows 8.1'
        }
      , {
          browserName: 'chrome'
        , platform: 'Windows 8.1'
        }
      , {
          browserName: 'internet explorer'
        , platform: 'Windows 8.1'
        , version: '10'
        }
      , {
          browserName: 'internet explorer'
        , platform: 'WIN7'
        , version: '9'
        }
      , {
          browserName: 'iphone'
        , platform: 'OS X 10.9'
        , version: '7'
        , 'device-orientation': 'portrait'
        }
      , {
          browserName: 'ipad'
        , platform: 'OS X 10.9'
        , version: '6'
        , 'device-orientation': 'portrait'
        }
      , {
          browserName: 'android'
        , platform: 'Linux'
        , version: '4.0'
        , 'device-orientation': 'portrait'
        }
      , {
          browserName: 'android'
        , platform: 'Linux'
        , version: '4.0'
        , 'device-type': 'tablet'
        , 'device-orientation': 'portrait'
        }];

    grunt.initConfig({
        connect: {
            server: {
                options: {
                    base: 'test',
                    port: 9999
                }
            }
        },
        'saucelabs-mocha': {
            all: {
                options: {
                    urls: ['http://127.0.0.1:9999'],
                    tunnelTimeout: 5,
                    build: process.env.TRAVIS_JOB_ID,
                    concurrency: 3,
                    browsers: browsers,
                    testname: 'ribcage-view',
                    tags: ['master']
                }
            }
        },
        watch: {
          scripts: {
            files: ['extend.js', 'Gruntfile.js', 'test/entry.js', 'test/fixtures/*.js']
          , tasks: ['atomifyJs', 'atomifyCss']
          , options: {
              interrupt: true
            }
          }
        }
    });

    // Loading dependencies
    for (var key in grunt.file.readJSON('package.json').devDependencies) {
        if (key !== 'grunt' && key.indexOf('grunt') === 0) grunt.loadNpmTasks(key);
    }

    grunt.registerTask('atomifyJs', 'Atomify the js', function () {
      var done = this.async()
        , outputFile = path.join(__dirname, 'test', 'bundle.js');

      atomifyJs({
        entry: path.join(__dirname, 'test', 'entry.js')
      , debug: false
      }, function (err, src) {
        if(err) {
          console.trace(err);
          return done(false);
        }

        // Prepend mocha's browser distributable
        src = mochaCode + ';' + src.toString();

        fs.writeFile(outputFile, src, function (err) {
          if(err) {
            console.trace(err);
            return done(false);
          }

          done();
        });
      });
    });

    grunt.registerTask('atomifyCss', 'Atomify the css', function () {
      var done = this.async()
        , outputFile = path.join(__dirname, 'test', 'bundle.css');

      atomifyCss({
        entry: path.join(__dirname, 'test', 'entry.css')
      }, function (err, src) {
        if(err) {
          console.trace(err);
          return done(false);
        }

        src = mochaStyle + '\n\n' + src.toString();

        fs.writeFile(outputFile, src, function (err) {
          if(err) {
            console.trace(err);
            return done(false);
          }

          done();
        });
      });
    });

    grunt.registerTask('dev', ['connect', 'atomifyJs', 'atomifyCss', 'watch']);
    grunt.registerTask('test', ['connect', 'saucelabs-mocha']);
};

{'fraction_non_alphanumeric': 0.14953617810760667, 'fraction_numerical': 0.010636982065553495, 'mean_word_length': 1.477328431372549, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6288896', 'n_tokens_mistral': 2547, 'n_tokens_neox': 2416, 'n_words': 460}