<commit_before>'use strict';

var fs = require('fs');
var http = require('http');
var util = require('util');

var del = require('del');
var gutil = require('gulp-util');
var ecstatic = require('ecstatic');
var DefaultRegistry = require('undertaker-registry');

function CommonRegistry(){
  DefaultRegistry.call(this);

  var port = 8080;
  var buildDir = './build';
  var exists = fs.existsSync(buildDir);

  if(exists){
    throw new Error('Cannot initialize undertaker-common-tasks registry. `build/` directory exists.');
  }

  this.set('clean', function(cb){
    del([buildDir], cb);
  });

  this.set('serve', function(cb){
    http.createServer(
      ecstatic({ root: buildDir })
    ).listen(port, function(){
      gutil.log('Server started at http://0.0.0.0:' + port);
      cb();
    });
  });
}

util.inherits(CommonRegistry, DefaultRegistry);<commit_msg>export derp<commit_after>'use strict';

var fs = require('fs');
var http = require('http');
var util = require('util');

var del = require('del');
var gutil = require('gulp-util');
var ecstatic = require('ecstatic');
var DefaultRegistry = require('undertaker-registry');

function CommonRegistry(){
  DefaultRegistry.call(this);

  var port = 8080;
  var buildDir = './build';
  var exists = fs.existsSync(buildDir);

  if(exists){
    throw new Error('Cannot initialize undertaker-common-tasks registry. `build/` directory exists.');
  }

  this.set('clean', function(cb){
    del([buildDir], cb);
  });

  this.set('serve', function(cb){
    http.createServer(
      ecstatic({ root: buildDir })
    ).listen(port, function(){
      gutil.log('Server started at http://0.0.0.0:' + port);
      cb();
    });
  });
}

util.inherits(CommonRegistry, DefaultRegistry);

module.exports = CommonRegistry;
{'fraction_non_alphanumeric': 0.17590497737556562, 'fraction_numerical': 0.00904977375565611, 'mean_word_length': 4.127536231884058, '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': '2413783', 'n_tokens_mistral': 560, 'n_tokens_neox': 547, 'n_words': 132}