| 1 | package Dist::Conformance::Check::ToolConfiguration 0.006; | ||||||||||
| 2 | |||||||||||
| 3 | # ABSTRACT: The configuration files of the tools exist | ||||||||||
| 4 | |||||||||||
| 5 | 2 | ▶ | use 5.040; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use warnings FATAL => 'all'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 2 | ▶ | use re '/aasx'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 2 | ▶ | use Mojo::Base 'Dist::Conformance::Check', -signatures; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 2 | ▶ | use Dist::Conformance::Schema(); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | sub config_schema ($) { | ||||||||
|
Subroutine
config_schema: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 14 | return { | ||||||||||
| 15 | 0 | required => ['files'], | |||||||||
| 16 | properties => { files => { type => 'object', additionalProperties => { %$Dist::Conformance::Schema::PATH, nullable => 1 } } }, | ||||||||||
| 17 | }; | ||||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | sub check ( $self, $snapshot ) { | ||||||||
|
Subroutine
check: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 22 | 0 | my @missing = $self->missing( $snapshot, sort keys %{ $self->config->{files} } ); | |||||||||
| 23 | 0 | ▶ | return ( 'fail', 'missing: ' . join ', ', @missing ) if @missing; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 0 | return ( 'pass', 'all present' ); | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | sub update ( $self, $update ) { | ||||||||
|
Subroutine
update: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 29 | 0 | my $files = $self->config->{files}; | |||||||||
| 30 | 0 | for my $path ( $self->missing( $update->snapshot, sort keys %$files ) ) { | |||||||||
| 31 | 0 | ▶ | if ( defined $files->{$path} ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 0 | $self->write_template( $update, $path, $files->{$path} ); | |||||||||
| 33 | } | ||||||||||
| 34 | else { | ||||||||||
| 35 | 0 | $update->by_hand("Write $path by hand: the flavor names no template for it"); | |||||||||
| 36 | } | ||||||||||
| 37 | } | ||||||||||
| 38 | 0 | return; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | __END__ | ||||||||||