QuoteCC/Output/Perl.pm

filter: Statementstmt 59.5% 25 / 42 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 69.2% 9 / 13 Podpod 0.0% 0 / 1 totaltotal 60.7% 34 / 56 CC 1 SCAR 2.7
CC
1
Cov
60%
_build_template
2.0
output
2.0
_process_template
2.0
CRAP 1.3
« QuoteCC/Output/C.pm ↑ Summary QuoteCC/Output/Lua.pm »
1 package App::QuoteCC::Output::Perl;
2 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 $App::QuoteCC::Output::Perl::AUTHORITY = 'cpan:AVAR';
4 }
5 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 $App::QuoteCC::Output::Perl::VERSION = '0.10';
7 }
8  
9 1 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Template;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use Data::Section qw/ -setup /;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use namespace::clean -except => [ qw/ meta merged_section_data section_data / ];
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 with qw/ App::QuoteCC::Role::Output /;
18  
19 1 has template => (
20 isa => 'Str',
21 is => 'ro',
22 lazy_build => 1,
23 documentation => "The Template template to emit",
24 );
25  
26 0 ▶sub _build_template {
Subroutine _build_template: not called CC=1 SCAR=6.9
27 0 my ($self) = @_;
28 0 my $template = $self->section_data( 'program' );
29 0 return $$template;
30 }
31  
32 0 ▶sub output {
Subroutine output: not called CC=1 SCAR=6.9
Pod undocumented
33 0 my ($self) = @_;
34 0 my $handle = $self->file_handle;
35  
36 # Get output
37 0 my $out = $self->_process_template;
38  
39 # Spew output
40 0 $self->spew_output($out);
41  
42 0 return;
43 }
44  
45 0 ▶sub _process_template {
Subroutine _process_template: not called CC=1 SCAR=6.9
46 0 my ($self) = @_;
47 0 my $quotes = $self->quotes;
48 0 my $template = $self->template;
49 0 my $out;
50  
51 Template->new->process(
52 \$template,
53 {
54 quotes => $quotes,
55 0 ▶ repeat => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
56 0 my ($s, $c) = @_;
57 0 $c += 4;
58 0 return scalar $s x $c;
59 },
60 },
61 0 \$out
62 );
63  
64 0 return $out;
65 }
66  
67 1 __PACKAGE__->meta->make_immutable;
68  
69 =encoding utf8
70  
71 =head1 NAME
72  
73 App::QuoteCC::Output::Perl - Emit quotes in Perl format
74  
75 =head1 AUTHOR
76  
77 E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason <avar@cpan.org>
78  
79 =head1 LICENSE AND COPYRIGHT
80  
81 Copyright 2010 E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason <avar@cpan.org>
82  
83 This program is free software, you can redistribute it and/or modify
84 it under the same terms as Perl itself.
85  
86 =cut
87  
88 __DATA__
« QuoteCC/Output/C.pm ↑ Summary QuoteCC/Output/Lua.pm »