<commit_before>var util = require('util');
var spawn = require('child_process').spawn;
var which = require('shelljs').which;

function createSlimPreprocessor(config, logger) {
  var log, slimCommand, slimCommandAbsolute;
  var slimCommandArgs = [];

  config = config || {};
  log = logger.create('preprocessor.slim');
  slimCommand = config.slimrb || 'slimrb';
  slimCommandAbsolute = which(slimCommand);
  log.debug('Found slim command `' + slimCommand + '` at: `' + slimCommandAbsolute + '`');

  if(!slimCommandAbsolute) {
    log.error(
      "Could not find the slimrb command in your path: `" + slimCommand + "`\n" +
      "You may need to run `bundle install` in your project, or install it globally.\n" +
      "Or, you can configure where slimrb is inside your karma config file with:\n\t" +
      "slimPreprocessor: { slimrb: '/usr/local/slimrb' }`"
    );
    throw new Error("slimrb command not found");
  }

  if(typeof(config.slimrbOption) === 'string') {
    log.debug('Passing args to slim command (%s).', config.slimrbOption);
    slimCommandArgs.push(config.slimrbOption);
  } else if(config && Array.isArray(config.slimrbOption)){
    slimCommandArgs = config.slimrbOption;
  }

  return function(content, file, done) {
    var child, html, path, hadError;

    log.debug('Processing "%s".', file.originalPath);<commit_msg>Adding debug log for array options<commit_after>var util = require('util');
var spawn = require('child_process').spawn;
var which = require('shelljs').which;

function createSlimPreprocessor(config, logger) {
  var log, slimCommand, slimCommandAbsolute;
  var slimCommandArgs = [];

  config = config || {};
  log = logger.create('preprocessor.slim');
  slimCommand = config.slimrb || 'slimrb';
  slimCommandAbsolute = which(slimCommand);
  log.debug('Found slim command `' + slimCommand + '` at: `' + slimCommandAbsolute + '`');

  if(!slimCommandAbsolute) {
    log.error(
      "Could not find the slimrb command in your path: `" + slimCommand + "`\n" +
      "You may need to run `bundle install` in your project, or install it globally.\n" +
      "Or, you can configure where slimrb is inside your karma config file with:\n\t" +
      "slimPreprocessor: { slimrb: '/usr/local/slimrb' }`"
    );
    throw new Error("slimrb command not found");
  }

  if(typeof(config.slimrbOption) === 'string') {
    log.debug('Passing args to slim command (%s).', config.slimrbOption);
    slimCommandArgs.push(config.slimrbOption);
  } else if(config && Array.isArray(config.slimrbOption)){
    log.debug('Passing args to slim command (%s).', config.slimrbOption);
    slimCommandArgs = config.slimrbOption;
  }

  return function(content, file, done) {
    var child, html, path, hadError;

    log.debug('Processing "%s".', file.originalPath);
{'fraction_non_alphanumeric': 0.14311398777418194, 'fraction_numerical': 0.0, 'mean_word_length': 4.113970588235294, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7067434', 'n_tokens_mistral': 874, 'n_tokens_neox': 868, 'n_words': 229}