diff options
author | dakkar <dakkar@thenautilus.net> | 2015-09-10 15:46:11 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2015-09-10 15:46:11 +0100 |
commit | 99f8ccd6cddc6fa9a021d4118e6a706a19e474b1 (patch) | |
tree | 5316e1bbfed711087393f4a1e8fd103cbc5d9cfb /lib/WebCoso/Maker.pm | |
parent | work around rakudo bug #126006 (diff) | |
download | WebCoso-p6-99f8ccd6cddc6fa9a021d4118e6a706a19e474b1.tar.gz WebCoso-p6-99f8ccd6cddc6fa9a021d4118e6a706a19e474b1.tar.bz2 WebCoso-p6-99f8ccd6cddc6fa9a021d4118e6a706a19e474b1.zip |
maybe I got deps working
I'd still like to make the whole thing more readable, though
Diffstat (limited to 'lib/WebCoso/Maker.pm')
-rw-r--r-- | lib/WebCoso/Maker.pm | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/lib/WebCoso/Maker.pm b/lib/WebCoso/Maker.pm index 91ceb03..b64c9cf 100644 --- a/lib/WebCoso/Maker.pm +++ b/lib/WebCoso/Maker.pm @@ -4,7 +4,7 @@ role WebCoso::Maker[$from,$to] { has $.basename; has $.dir; - method process-contents(:$src,:@deps) { ... } + method process-contents($src) { ... } method dest-files() { say "Maker[$from,$to]($.dir/$.basename)::dest-files"; @@ -16,8 +16,16 @@ role WebCoso::Maker[$from,$to] { return $.wc.get-files($.dir,$.basename,$from); } + method get-file($path) { + return $.wc.get-file($.dir,$path); + } + method dep-files() { - return Hash; + return $.wc.load-deps($.dir,$.basename,$to); + } + + method set-deps(%deps) { + $.wc.save-deps($.dir,$.basename,$to,%deps); } method make() { @@ -34,20 +42,22 @@ role WebCoso::Maker[$from,$to] { my @deps = %deps{$lang} // (); say "Maker[$from,$to]($.dir/$.basename)::make lang $lang"; say "Maker[$from,$to]($.dir/$.basename)::make dst modified {$dst ?? $dst.modified !! 'not-there'} src modified {$src.modified}"; - next if $dst and $dst.modified after + next if $dst and not $dst.modified before all($src.modified,@depsĀ».modified.flat); say "Maker[$from,$to]($.dir/$.basename)::make processing $lang"; - my $processed-contents = self.process-contents( - src => $src.slurp, - deps => @depsĀ».slurp, + my ($processed-contents,@new_deps) = self.process-contents( + $src, ); - # that .Str.IO is a hack to work around - # https://rt.perl.org/Public/Bug/Display.html?id=126006 %dsts{$lang} = $.wc.put-file($.dir,$.basename,$lang,$to, - $processed-contents).Str.IO; + $processed-contents); + %deps{$lang} = @new_deps + if @new_deps; } + + $.set-deps(%deps); + return %dsts; } } |