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

'use strict';

var huxley = require('huxley');
var exec = require('child_process').exec;

module.exports = function(grunt) {
  grunt.registerMultiTask('huxley', 'Grunt task for node-huxley.', function() {
    var browser = this.options().browser;
    var serverUrl = this.options().server;
    var path = this.filesSrc;

    if (this.options().driver)
      huxley.injectDriver(this.options().driver());

    var done = this.async();
    function doneCallback(err) {
      if (err) {
        grunt.log.error(err);
        return done(false);
      }
      done();
    }
    switch (this.options().action) {
      case 'record':
        huxley.recordTasks(browser, serverUrl, path, doneCallback);
        break;
      case 'update':
        huxley.playbackTasksAndSaveScreenshots(browser, serverUrl, path, doneCallback);
        break;
      default:
        huxley.playbackTasksAndCompareScreenshots(browser, serverUrl, path, doneCallback);
    }
  });
};<commit_msg>Curlies in driver if statement.<commit_after>/*
 * grunt-huxley
 * https://github.com/chenglou/grunt-huxley
 *
 * Copyright (c) 2013 chenglou
 * Licensed under the MIT license.
 */

'use strict';

var huxley = require('huxley');
var exec = require('child_process').exec;

module.exports = function(grunt) {
  grunt.registerMultiTask('huxley', 'Grunt task for node-huxley.', function() {
    var browser = this.options().browser;
    var serverUrl = this.options().server;
    var path = this.filesSrc;

    if (this.options().driver) {
      huxley.injectDriver(this.options().driver());
    }

    var done = this.async();
    function doneCallback(err) {
      if (err) {
        grunt.log.error(err);
        return done(false);
      }
      done();
    }
    switch (this.options().action) {
      case 'record':
        huxley.recordTasks(browser, serverUrl, path, doneCallback);
        break;
      case 'update':
        huxley.playbackTasksAndSaveScreenshots(browser, serverUrl, path, doneCallback);
        break;
      default:
        huxley.playbackTasksAndCompareScreenshots(browser, serverUrl, path, doneCallback);
    }
  });
};
{'fraction_non_alphanumeric': 0.13825088339222616, 'fraction_numerical': 0.0035335689045936395, 'mean_word_length': 3.015957446808511, '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': '4284955', 'n_tokens_mistral': 733, 'n_tokens_neox': 712, 'n_words': 148}