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

function builder(dir) {
	this.dir = dir;	
}

builder.prototype.build = function(req, callback) {
	var self = this,
		name = req.params[0],
		output = [],
		originalUrl = req.originalUrl;

	output.push("(function(definition) {");	
	output.push("doodads.setup('" + originalUrl + "', definition);");

	// definition
	var definitionBuffer = fs.readFileSync(this.dir + '/' + name + '/' + name + '.json'),<commit_msg>fixed paths computations<commit_after>var fs = require('fs'),
	path = require('path');

function builder(dir) {
	this.dir = dir;	
}

builder.prototype.build = function(req, callback) {
	var self = this,
		n = req.params[0],
		output = [],
		originalUrl = req.originalUrl;

	output.push("(function(definition) {");	
	output.push("doodads.setup('" + originalUrl + "', definition);");

	var directory = path.dirname(originalUrl),
		filename = path.basename(originalUrl, '.doodad')

	// definition
	var definitionBuffer = fs.readFileSync(this.dir + '/' + directory + '/' + filename + '/' + filename + '.json'),
{'fraction_non_alphanumeric': 0.18543046357615894, 'fraction_numerical': 0.001892147587511826, 'mean_word_length': 4.370558375634518, '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': '3388638', 'n_tokens_mistral': 358, 'n_tokens_neox': 344, 'n_words': 68}