generate_pods.pl

filter: Statementstmt 100% 24 / 24 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 96.6% 29 / 30 CC 3 SCAR 6.9
CC
3
Cov
96%
generate_pod
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« blib/lib/App/generate_pods.pl ↑ Summary blib/lib/App/RecordStream/Clumper/Window.pm »
1 #!/usr/bin/env perl
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use File::Basename qw(basename);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 $ENV{'PERL5LIB'} .= ':lib';
9  
10 # Don't let the actual terminal size affect POD every time we generate it.
11 # LINES isn't used by us, but is required for Term::ReadKey::GetTerminalSize()
12 # to use COLUMNS.
13 1 $ENV{'COLUMNS'} = 80;
14 1 $ENV{'LINES'} = 50;
15  
16 1 generate_pod($_) for grep { not /recs-operation/ } <bin/recs-*>;
17  
18 sub generate_pod {
19 40 ▶ my $script = shift;
Subroutine generate_pod: called CC=3 SCAR=11.0
20  
21 40 print "Generating pod documentation for $script\n";
22  
23 40 my $script_base = basename($script);
24  
25 40 my @help = `$^X $script --help-all 2>/dev/null`;
26  
27 40 ▶ open(my $fh, '>', "doc/$script_base.pod") or die "Could not open doc/$script_base.pod: $!";
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, ">", "doc/$script_base.pod" or die "Could not open doc/$script_base.pod: $!" 0 40 40
28  
29 40 print $fh <<HEADER;
30 =head1 NAME
31  
32 $script_base
33  
34 =head1 $script_base --help-all
35  
36 HEADER
37  
38 40 foreach my $line (@help) {
39 3764 print $fh " " . $line;
40 }
41  
42 40 print $fh <<FOOTER;
43  
44 =head1 SEE ALSO
45  
46 =over
47  
48 =item * See L<App::RecordStream> for an overview of the scripts and the system
49  
50 =item * Run C<recs examples> or see L<App::RecordStream::Manual::Examples> for a set of simple recs examples
51  
52 =item * Run C<recs story> or see L<App::RecordStream::Manual::Story> for a humorous introduction to RecordStream
53  
54 =item * Every command has a C<--help> mode available to print out usage and
55 examples for the particular command, just like the output above.
56  
57 =back
58  
59 FOOTER
60  
61 40 close $fh;
62 }
« blib/lib/App/generate_pods.pl ↑ Summary blib/lib/App/RecordStream/Clumper/Window.pm »