bin/screenplay-text--list-images

filter: Statementstmt 96.4% 27 / 28 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 94.7% 36 / 38 CC 1 SCAR 0.0
CC
1
Cov
94%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm ↑ Summary blib/lib/XML/Grammar/Fiction.pm »
1 #!/usr/bin/env perl
2  
3 2 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use XML::Grammar::Screenplay::FromProto::API::ListImages ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use XML::Grammar::Screenplay::FromProto::Parser::QnD ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use Getopt::Long qw/ GetOptions /;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 my $output_fn;
13 2 my $show_fn = '';
14 2 GetOptions( "output|o=s" => \$output_fn, 'with-filename!' => \$show_fn, );
15  
16 2 my $image_lister =
17 XML::Grammar::Screenplay::FromProto::API::ListImages->new( {} );
18  
19 2 foreach my $fn (@ARGV)
20 {
21 2 ▶ my $got_doc = (
Branch: 1 branch
BranchTrueFalseTotal
$fn =~ /\.screenplay-xml\.xml\z/u ? : 1 1 2
22 ( $fn =~ /\.screenplay-xml\.xml\z/ )
23 ? $image_lister->calc_doc__from_intermediate_xml(
24 { filename => $fn, }
25 )
26 : $image_lister->calc_doc__from_proto_text(
27 {
28 source => {
29 file => $fn,
30 },
31 }
32 )
33 );
34  
35 2 foreach my $img ( @{ $got_doc->list_images() } )
36 {
37 6 ▶ if ($show_fn)
Branch: 1 branch
BranchTrueFalseTotal
if ($show_fn) 0 6 6
38 {
39 0 print $fn, ":";
40 }
41 6 say $img->uri();
42 }
43 }
44  
45 1;
46  
47 __END__
« blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm ↑ Summary blib/lib/XML/Grammar/Fiction.pm »