blib/lib/Markdown/Pod/Embed/Constant.pm

filter: Statementstmt 90.9% 30 / 33 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 85.7% 6 / 7 Podpod n/a totaltotal 79.5% 39 / 49 CC 1 SCAR 1.3
CC
1
Cov
82%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/Markdown/Pod/Embed/Util.pm ↑ Summary bin/markpod »
1 #
2 # This file is part of Markdown::Pod::Embed.
3 #
4 # This software is copyright (c) 2026 by Andrew Speer <andrew.speer@isolutions.com.au>.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 # Full license text is available at:
10 #
11 # <http://dev.perl.org/licenses/>
12 #
13 package Markdown::Pod::Embed::Constant;
14  
15  
16 # Compiler pragma and package variables
17 #
18 8 ▶use strict qw(vars);
Subroutine BEGIN: called CC=1 SCAR=0.0
19 8 ▶use vars qw($VERSION @ISA @EXPORT $OPTION_HR $PANDOC_EXE
Subroutine BEGIN: called CC=1 SCAR=0.0
20 8 $PANDOC_CMD_MD2TEXT_CR);
21 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23  
24 # External packages
25 #
26 8 ▶use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 8 ▶use Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 8 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30  
31 # Version and exports
32 #
33 8 $VERSION='1.012';
34 8 @ISA=qw(Exporter);
35 8 @EXPORT=qw($OPTION_HR $PANDOC_EXE $PANDOC_CMD_MD2TEXT_CR);
36  
37  
38 # Default processor options
39 #
40 8 $OPTION_HR={dialect => 'GitHub'};
41  
42  
43 # Find Pandoc when it is available for plain-text rendering
44 #
45 8 $PANDOC_EXE='';
46 8 foreach my $dir (File::Spec->path()) {
47 80 foreach my $name (qw(pandoc pandoc.exe)) {
48 160 my $fn=File::Spec->catfile($dir, $name);
49 160 ▶ if (-f $fn && -x $fn) {
Branch: 1 branch
BranchTrueFalseTotal
if (-f $fn and -x $fn) 0 160 160
Condition33%1/3
-f $fn and -x $fn
!ll&&!rl&&r
16000
MC/DC0%0/2
-f $fn and -x $fn
-f $fn -x $fn
Truth table33%1/3
A and B
A= -f $fnB= -x $fn
ABresult
0X0
100
111
50 0 $PANDOC_EXE=$fn;
51 0 last;
52 }
53 }
54 80 ▶ last if $PANDOC_EXE;
Branch: 1 branch
BranchTrueFalseTotal
if $Markdown::Pod::Embed::Constant::PANDOC_EXE 0 80 80
55 }
56  
57  
58 # Construct the Markdown-to-text Pandoc command
59 #
60 0 ▶$PANDOC_CMD_MD2TEXT_CR=sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
61 0 return [shift(), '-f', 'gfm', '-t', 'plain', shift()];
62 8 };
63  
64  
65 # Done
66 #
67 8 1;
68 __END__
« blib/lib/Markdown/Pod/Embed/Util.pm ↑ Summary bin/markpod »