Changelord/Command/Schema.pm

filter: Statementstmt 91.3% 21 / 23 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 1 totaltotal 81.8% 27 / 33 CC 2 SCAR 8.1
CC
2
Cov
84%
run
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
« Changelord/Command/Add.pm ↑ Summary Changelord/Command/Validate.pm »
1 package App::Changelord::Command::Schema;
2 2 our $AUTHORITY = 'cpan:YANICK';
3 # SYNOPSIS: print out the changelog schema
4 2 $App::Changelord::Command::Schema::VERSION = '0.0.2';
5 2 ▶use 5.36.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 use CLI::Osprey
9 2 ▶ doc => 'print JSON schema for the changelog format',
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 description_pod => <<'END';
11 Print the JSON schema describing the data format used by changelord.
12  
13 By defaults prints the schema in YAML. Can also be printed as JSON
14 via the C<--json> option.
15 END
16  
17 2 ▶use Path::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶use YAML;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 2 option json => (
22 is => 'ro',
23 default => 0,
24 doc => 'output schema as json',
25 );
26  
27 0 ▶sub run($self) {
Subroutine run: not called CC=2 SCAR=17.9
Pod undocumented
28  
29 0 my $schema = YAML::Load(path(__FILE__)->sibling('changelog-schema.yml')->slurp);
30  
31 0 ▶ print $self->json ? JSON->new->pretty->encode(YAML::Load($schema)) : YAML::Dump($schema);
Branch: 1 branch
BranchTrueFalseTotal
$self->json ? : 0 0 0
32 }
33  
34 2 'end of App::Changelog::Command::Schema';
35  
36 __END__
« Changelord/Command/Add.pm ↑ Summary Changelord/Command/Validate.pm »