<commit_before>module BreakDancer;
use Shell::Command;

our $basedir = 'www';

multi gen($path, &code) is export {
    mkpath "$basedir/$path";
    given open("$basedir/$path/index.htm", :w) {
        .say: &code();
        .close;
    }
}

multi gen($path, @args, &code) is export {
    mkpath "$basedir/$path";
    for @args -> $a {
        my $p = "$basedir/$path/$a";
        mkpath $p;
        given open("$p/index.htm", :w) {
            .say: &code($a);
            .close;
        }
    }
}

multi gen($path, %args, &code) is export {
    mkpath "$basedir/$path";
    for %args.kv -> $k, $v {
        my $p = "$basedir/$path/$k";
        mkpath $p;
        given open("$p/index.htm", :w) {
            .say: &code($k, $v);
            .close;
        }
    }
}<commit_msg>[lib/BreakDancer.pm] html instead of htm<commit_after>module BreakDancer;
use Shell::Command;

our $basedir = 'www';

multi gen($path, &code) is export {
    mkpath "$basedir/$path";
    given open("$basedir/$path/index.html", :w) {
        .say: &code();
        .close;
    }
}

multi gen($path, @args, &code) is export {
    mkpath "$basedir/$path";
    for @args -> $a {
        my $p = "$basedir/$path/$a";
        mkpath $p;
        given open("$p/index.html", :w) {
            .say: &code($a);
            .close;
        }
    }
}

multi gen($path, %args, &code) is export {
    mkpath "$basedir/$path";
    for %args.kv -> $k, $v {
        my $p = "$basedir/$path/$k";
        mkpath $p;
        given open("$p/index.html", :w) {
            .say: &code($k, $v);
            .close;
        }
    }
}
{'fraction_non_alphanumeric': 0.2, 'fraction_numerical': 0.0, 'mean_word_length': 1.8360071301247771, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6093993', 'n_tokens_mistral': 591, 'n_tokens_neox': 585, 'n_words': 136}