lib/PDF/FDF/Simple/Builder.pm

filter: Statementstmt 65.3% 17 / 26 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 100% 1 / 1 totaltotal 65.7% 23 / 35 CC 2 SCAR 8.9
CC
2
Cov
61%
ACTION_grammar
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.4
« blib/lib/PDF/FDF/Simple.pm ↑ Summary
1 package PDF::FDF::Simple::Builder;
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 Module::Build;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use File::Copy "mv";
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 @ISA = ("Module::Build");
11  
12 sub ACTION_grammar
13 0 ▶{
Subroutine ACTION_grammar: not called CC=2 SCAR=17.9
Pod documented
14 0 require Parse::RecDescent;
15  
16 0 my $grammar_file ='lib/auto/PDF/FDF/Simple/grammar';
17 0 ▶ open GRAMMAR_FILE, $grammar_file or die "Cannot open grammar file ".$grammar_file;
Branch: 1 branch
BranchTrueFalseTotal
open GRAMMAR_FILE, $grammar_file or die 'Cannot open grammar file ' . $grammar_file 0 0 0
18 0 local $/;
19 0 my $grammar = <GRAMMAR_FILE>;
20  
21 0 Parse::RecDescent->Precompile($grammar, "PDF::FDF::Simple::Grammar");
22 0 my $target = "lib/PDF/FDF/Simple/Grammar.pm";
23 0 mv "Grammar.pm", $target;
24 0 print "Updated $target\n";
25 }
26  
27  
28 1 1;
29  
30 =pod
31  
32 =head1 NAME
33  
34 PDF::FDF::Simple::Builder - Module::Build extensions for PDF::FDF::Simple
35  
36 =head1 SYNOPSIS
37  
38 perl Build.PL
39 ./Build grammar
40 ./Build
41 ./Build test
42 ./Build install
43  
44 =head1 DESCRIPTION
45  
46 Provides Module::Build extensions, mainly for precompiling the grammar
47 file.
48  
49 =head1 FUNCTIONS
50  
51 =head2 ACTION_grammar
52  
53 This defines an Build action C<grammar> which precompiles the grammar
54 using Parse::RecDescent and moves the file to
55 lib/PDF/FDF/Simple/Grammar.pm. It is usually done by the maintainer,
56 before he builds a dist file for CPAN.
57  
58 =head1 AUTHOR
59  
60 =over 4
61  
62 =item *
63  
64 Steffen Schwigon <ss5@renormalist.net>,
65  
66 =back
67  
68 =cut
« blib/lib/PDF/FDF/Simple.pm ↑ Summary