<commit_before>
var fs = require('fs');
var sys = require('sys');
var path = require('path');

var filename = __dirname + '/jasmine-1.0.1.js';
global.window = {
  setTimeout: setTimeout,
  clearTimeout: clearTimeout,
  setInterval: setInterval,
  clearInterval: clearInterval
};

var src = fs.readFileSync(filename);
var jasmine;
var minorVersion = process.version.match(/\d\.(\d)\.\d/)[1];
switch (minorVersion) {
  case "1":
  case "2":
    jasmine = process.compile(src + '\njasmine;', filename);
    break;
  default:
    jasmine = require('vm').runInThisContext(src + "\njasmine;", filename);
}

delete global.window;

jasmine.TerminalReporter = require('./reporter').TerminalReporter;

jasmine.loadHelpersInFolder=function(folder, matcher)
{
  var helpers = jasmine.getAllSpecFiles(folder, matcher);

  for (var i = 0, len = helpers.length; i < len; ++i)
  {
    var filename = helpers[i];
    var helper= require(filename.replace(/\.*$/, ""));
    for (var key in helper)
      global[key]= helper[key];
  }
};

jasmine.executeSpecsInFolder = function(folder, done, isVerbose, showColors, matcher) {
  var fileMatcher = matcher || new RegExp(".(js)$", "i");
  var specs = jasmine.getAllSpecFiles(folder, fileMatcher);<commit_msg>perhaps this could be a fix for issue #27; I think the hole helper loading is suboptimal...<commit_after>
var fs = require('fs');
var sys = require('sys');
var path = require('path');

var filename = __dirname + '/jasmine-1.0.1.js';
global.window = {
  setTimeout: setTimeout,
  clearTimeout: clearTimeout,
  setInterval: setInterval,
  clearInterval: clearInterval
};

var src = fs.readFileSync(filename);
var jasmine;
var minorVersion = process.version.match(/\d\.(\d)\.\d/)[1];
switch (minorVersion) {
  case "1":
  case "2":
    jasmine = process.compile(src + '\njasmine;', filename);
    break;
  default:
    jasmine = require('vm').runInThisContext(src + "\njasmine;", filename);
}

delete global.window;

jasmine.TerminalReporter = require('./reporter').TerminalReporter;

jasmine.loadHelpersInFolder=function(folder, matcher)
{
  var helpers = [];

  if(fs.statSync(folder).isDirectory()) {
    helpers = jasmine.getAllSpecFiles(folder, matcher);
  } else {
    folder = path.dirname(folder);
    helpers = jasmine.getAllSpecFiles(folder, matcher);
  }

  for (var i = 0, len = helpers.length; i < len; ++i)
  {
    var filename = helpers[i];
    var helper= require(filename.replace(/\.*$/, ""));
    for (var key in helper)
      global[key]= helper[key];
  }
};

jasmine.executeSpecsInFolder = function(folder, done, isVerbose, showColors, matcher) {
  var fileMatcher = matcher || new RegExp(".(js)$", "i");
  var colors = showColors || false;
  var specs = [];

  if (fs.statSync(folder).isDirectory()) {
    specs = jasmine.getAllSpecFiles(folder, fileMatcher);
  } else {
    specs.push(folder);
  }
{'fraction_non_alphanumeric': 0.16199158485273493, 'fraction_numerical': 0.005610098176718092, 'mean_word_length': 4.1872727272727275, 'pattern_counts': {'":': 4, '<': 5, '<?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': '6479360', 'n_tokens_mistral': 986, 'n_tokens_neox': 952, 'n_words': 222}