diff options
author | dakkar <dakkar@thenautilus.net> | 2015-09-05 16:21:29 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2015-09-05 16:21:29 +0100 |
commit | 4078424b9105dba16c50087347b3a607cd75d4d1 (patch) | |
tree | bd81983e27be76dcb28254f26c5359be47a8aa8d /lib/WebCoso/Maker.pm | |
parent | more tests (diff) | |
download | WebCoso-p6-4078424b9105dba16c50087347b3a607cd75d4d1.tar.gz WebCoso-p6-4078424b9105dba16c50087347b3a607cd75d4d1.tar.bz2 WebCoso-p6-4078424b9105dba16c50087347b3a607cd75d4d1.zip |
first maker test
Diffstat (limited to 'lib/WebCoso/Maker.pm')
-rw-r--r-- | lib/WebCoso/Maker.pm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/WebCoso/Maker.pm b/lib/WebCoso/Maker.pm index e9564fa..5aae4f8 100644 --- a/lib/WebCoso/Maker.pm +++ b/lib/WebCoso/Maker.pm @@ -1,21 +1,22 @@ # -*- mode: perl6 -*- -role Maker[:$from,:$to] { - has $!wc; +role WebCoso::Maker[$from,$to] { + has $.wc; has $.basename; has $.dir; - method process-contents(:$from-contents) { ... } + method process-contents($from-contents) { ... } method get-files() { - my %dsts = $!wc.get-files($.dir,$.basename,$from); - my %srcs = $!wc.get-files($.dir,$.basename,$to); + 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{$lang} and %dsts{$lang}.modified after $src.modified; - my $processed-contents = .process-contents($src.slurp); - %dsts{$lang} = $!wc.put-file($.dir,$.basename,$lang,$to, + my $processed-contents = self.process-contents($src.slurp); + %dsts{$lang} = $.wc.put-file($.dir,$.basename,$lang,$to, $processed-contents) } + return %dsts; } } |