Skip to content

Commit

Permalink
fix plugins doc
Browse files Browse the repository at this point in the history
  • Loading branch information
melezhik committed Jul 13, 2024
1 parent 044eb4a commit d83ec94
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
9 changes: 3 additions & 6 deletions bin/sparky-runner.raku
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,9 @@ LEAVE {
my %config = read-config($DIR);

if %config<plugins> {
my $i = %config<plugins>.iterator;
for 1 .. %config<plugins>.elems {
my $plg = $i.pull-one;
my $plg-name = $plg.keys[0];
my %plg-params = $plg{$plg-name}<parameters>;
my $run-scope = $plg{$plg-name}<run_scope> || 'anytime';
for %config<plugins>.kv -> $plg-name, $plg-data {
my %plg-params = $plg-data<parameters> || %();
my $run-scope = $plg-data<run_scope> || 'anytime';

#say "$plg-name, $run-scope, $SPARKY-BUILD-STATE";
if ( $run-scope eq "fail" and $SPARKY-BUILD-STATE ne "FAILED" ) {
Expand Down
4 changes: 2 additions & 2 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ That contains:

```yaml
plugins:
- Sparky::Plugin::Email:
Sparky::Plugin::Email:
parameters:
subject: "I finished"
to: "[email protected]"
text: "here will be log"
- Sparky::Plugin::Hello:
Sparky::Plugin::Hello:
parameters:
name: Sparrow
```
Expand Down
18 changes: 18 additions & 0 deletions misc/yaml-test.raku
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use YAMLish;

my $data = load-yaml('plugins:
Sparky::Plugin::Email:
parameters:
subject: "I finished"
to: "[email protected]"
text: "here will be log"
Sparky::Plugin::Hello:
parameters:
name: Sparrow
');

say $data.perl;

for $data<plugins><>.kv -> $k, $v {
say $k;
}

0 comments on commit d83ec94

Please sign in to comment.