<commit_before>var path = require('path')
  , utils = require('utilities')
  , FunctionRouter = require('../routers/function_router').FunctionRouter
  , RegExpRouter = require('barista').Router;

geddy.FunctionRouter = FunctionRouter;
geddy.RegExpRouter = RegExpRouter;

module.exports = new (function () {

  this.init = function (app, callback) {
    var cwd = process.cwd()
      , routerCsFile = path.join(cwd, '/config/router.coffee')
      , router;

    if (utils.file.existsSync(routerCsFile)) {
      utils.file.requireLocal('coffee-script');
    }
    router = require(path.join(cwd, '/config/router'));
    router = router.router || router;
    app.router = router;
<commit_msg>Monkeypatch Barista for toString fix<commit_after>var path = require('path')
  , utils = require('utilities')
  , FunctionRouter = require('../routers/function_router').FunctionRouter
  , RegExpRouter = require('barista').Router;

// Monkeypatch Barista until we can get a proper fix in
RegExpRouter.prototype.toString = function() {
  var r = this.routes.map(function(rt) {
    return rt.toString();
  });
  return r ? r.join('\n') : '';
};

geddy.FunctionRouter = FunctionRouter;
geddy.RegExpRouter = RegExpRouter;

module.exports = new (function () {

  this.init = function (app, callback) {
    var cwd = process.cwd()
      , routerCsFile = path.join(cwd, '/config/router.coffee')
      , router;

    if (utils.file.existsSync(routerCsFile)) {
      utils.file.requireLocal('coffee-script');
    }
    router = require(path.join(cwd, '/config/router'));
    router = router.router || router;
    app.router = router;

{'fraction_non_alphanumeric': 0.15065096094234345, 'fraction_numerical': 0.0, 'mean_word_length': 3.7893175074183976, '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': '5151830', 'n_tokens_mistral': 515, 'n_tokens_neox': 505, 'n_words': 100}