summaryrefslogtreecommitdiff
path: root/lib/WebCoso/Maker.pm
blob: 5aae4f89e78cb4c4c30cd2f8aa4574e88af0be5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -*- mode: perl6 -*- 
role WebCoso::Maker[$from,$to] {
    has $.wc;
    has $.basename;
    has $.dir;
 
    method process-contents($from-contents) { ... }
 
    method get-files() {
        my %srcs = $.wc.get-files($.dir,$.basename,$from);
        my %dsts = $.wc.get-files($.dir,$.basename,$to);
        for %srcs.keys -> $lang {
            my $src = %srcs{$lang};
            next if %dsts{$langand
                                 %dsts{$lang}.modified after $src.modified;
            my $processed-contents = self.process-contents($src.slurp);
            %dsts{$lang} = $.wc.put-file($.dir,$.basename,$lang,$to,
                                         $processed-contents)
        }
        return %dsts;
    }
}