Skip to content

Commit

Permalink
Produce some json output
Browse files Browse the repository at this point in the history
A bit LTA but good enough for some purposes. Resolves #5.
  • Loading branch information
AlexDaniel committed Feb 7, 2019
1 parent 57c0707 commit 80417a8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions bin/blin.p6
Expand Up @@ -74,6 +74,7 @@ my $output-path = ‘output’.IO;
my $overview-path = $output-path.add: overview;
my $dot-path = $output-path.add: overview.dot;
my $svg-path = $output-path.add: overview.svg;
my $json-path = $output-path.add: data.json;

mkdir $output-path;
unlink $overview-path;
Expand Down Expand Up @@ -346,6 +347,25 @@ sub save-overview {

save-overview;


note 🥞🥞 Saving the json output;
{
my %json-data;
for @modules {
my $status = .done ?? .done.result !! Unknown;
my $output = .output-new;
my $name = .name;
# TODO uhh, there can be more than one entry with the same name…
# … whatever…
my $version = .version;
%json-data{$name}<version> = ~$version;
%json-data{$name}<status> = ~$status;
%json-data{$name}<output> = $output;
}
use JSON::Fast;
spurt $json-path, to-json %json-data;
}

note 🥞🥞 Saving the dot file;
my @bisected = @modules.grep(*.done.result == Fail);
# Not algorithmicaly awesome, but will work just fine in practice
Expand Down

0 comments on commit 80417a8

Please sign in to comment.