Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instead of generating pod files each time for each test that needs it, generate a cache as we go, that uses the timestamp to insure we don't regen them if not needed. This temporarily removes the concurrency from some files. Related to #1952
- Loading branch information
Showing
6 changed files
with
48 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ highlights/node_modules | |
highlights/atom-language-perl6/ | ||
.DS_store | ||
highlights/package-lock.json | ||
.pod-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
unit class Pod::Cache; | ||
|
||
# Given a filename, generate a cached, rendered version of the POD | ||
# in that file as text. | ||
|
||
method cache-file(Str $file --> Str) { | ||
my $outfile = '.pod-cache/' ~ $file; | ||
my $output-io = $outfile.IO; | ||
|
||
my $in-time = $file.IO.modified; | ||
my $out-time = $output-io.e ?? $output-io.modified !! 0; | ||
|
||
if $in-time > $out-time { | ||
mkdir $output-io.dirname; | ||
my $outfile = $output-io.open(:w); | ||
$outfile.lock; | ||
my $job = Proc::Async.new($*EXECUTABLE-NAME, '--doc', $file); | ||
$job.stdout.tap(-> $buf {$outfile.print: $buf}); | ||
|
||
await $job.start; | ||
} | ||
$outfile | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters