Skip to content

Instantly share code, notes, and snippets.

@dontlaugh
Created January 20, 2023 15:25
Show Gist options
  • Save dontlaugh/8fee0ee7b855f8ac5141405e8e1d9e8d to your computer and use it in GitHub Desktop.
Save dontlaugh/8fee0ee7b855f8ac5141405e8e1d9e8d to your computer and use it in GitHub Desktop.
Template small files with Raku
#!/usr/bin/env raku
use v6.d;
# mention:
# priorities
# resource-based lb
my @gat-ids = [
(Q |Overprovisioning factor|, "https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/overprovisioning"),
];
my $id-index = 9;
for @gat-ids -> $gid {
# with 4 leading zeros
my $gat-id = sprintf "GAT%04s", $id-index;
my $description = $gid[0];
my $docs-url = $gid[1];
my $markdown-template = qq:to/END/;
# $gat-id $description
Status: Unknown
## Overview
$description is an Envoy feature. [Envoy docs]($docs-url).
## Testing Notes
_Offer testing guidance, mention special requirements, etc._
## Verifications
_Add links to Shortcut/JIRA or executed test plans here_
* ???
END
# say $markdown-template;
my $filename = "$gat-id $description".subst(/\s+/, "-", :g);
spurt "/home/coleman/Code/greymatter-acceptance-tests/scenarios/{$filename}.md", $markdown-template;
$id-index++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment