<commit_before>var assemble = require('assemble');
var path = require('path');
var lazy = require('lazy-cache')(require);
lazy('mixin-object', 'mixin');

var engine = require('engine-assemble');
var layouts = require('handlebars-layouts');

assemble.engine('hbs', engine);
engine.Handlebars.registerHelper(layouts(engine.Handlebars));
//assemble.helpers(layouts(engine.Handlebars));

assemble.helper('raw', require('../handlebars/helpers/raw'));
assemble.helper('doc', require('../handlebars/helpers/doc'));
assemble.helper('test', require('../handlebars/helpers/test'));

assemble.option('renameKey', function(filepath, options) {
    return path.relative(process.cwd() + '/src/tmpl/', filepath).replace('partials/', '').replace(path.extname(filepath), '');
});

assemble.option('mergeContext', function (view, ctx, locals) {
    var context = {};
    if(view.cwd) {
        var key = path.relative(view.cwd + '/src/tmpl', view.path).replace(path.extname(view.path), '');
        if(this.cache.data[key]) {
            lazy.mixin(context, this.cache.data[key]);
        }
    }
//    console.log(view.orig.match(/{{partial\s"([\w\/]+).*}}/g));
//    console.log('------------------');
    if (this.enabled('preferLocals')) {
        lazy.mixin(context, view.options);<commit_msg>compatible mode (win/osx) embedded into renameKey function<commit_after>var assemble = require('assemble');
var path = require('path');
var lazy = require('lazy-cache')(require);
lazy('mixin-object', 'mixin');

var engine = require('engine-assemble');
var layouts = require('handlebars-layouts');

assemble.engine('hbs', engine);
engine.Handlebars.registerHelper(layouts(engine.Handlebars));
//assemble.helpers(layouts(engine.Handlebars));

assemble.helper('raw', require('../handlebars/helpers/raw'));
assemble.helper('doc', require('../handlebars/helpers/doc'));
assemble.helper('test', require('../handlebars/helpers/test'));

assemble.option('renameKey', function(filepath, options) {
    return path.relative(process.cwd() + '/src/tmpl/', filepath).replace('partials/', '').replace(path.extname(filepath), '').replace(/\\/g, '/').replace('partials/', '');
});

assemble.option('mergeContext', function (view, ctx, locals) {
    var context = {};
    if(view.cwd) {
        var key = path.relative(view.cwd + '/src/tmpl', view.path).replace(path.extname(view.path), '');
        if(this.cache.data[key]) {
            lazy.mixin(context, this.cache.data[key]);
        }
    }
//    console.log(view.orig.match(/{{partial\s"([\w\/]+).*}}/g));
//    console.log('------------------');
    if (this.enabled('preferLocals')) {
        lazy.mixin(context, view.options);
{'fraction_non_alphanumeric': 0.22754716981132075, 'fraction_numerical': 0.0, 'mean_word_length': 4.239130434782608, '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': '5411330', 'n_tokens_mistral': 854, 'n_tokens_neox': 858, 'n_words': 121}