Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 25 lines (21 sloc) 0.502 kB
fa5e4b6 @tadzik Add basic tests and some code which accidentally passes them
tadzik authored
1 module BreakDancer;
2 use Shell::Command;
3
4 my $basedir = 'www';
5
6 multi gen($path, &code) is export {
7 mkpath "$basedir/$path";
8 given open("$basedir/$path/index.htm", :w) {
9 .say: &code();
10 .close;
11 }
12 }
13
14 multi gen($path is copy, %args, &code) is export {
15 mkpath "$basedir/$path";
16 for %args.kv -> $k, $v {
17 my $p = "$basedir/$path/$k";
18 mkpath $p;
19 given open("$p/index.htm", :w) {
20 .say: &code($k, $v);
21 .close;
22 }
23 }
24 }
Something went wrong with that request. Please try again.