Resume/MoopsParserTrait.pm

filter: Statementstmt 97.4% 38 / 39 Branchbran 50.0% 3 / 6 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 89.2% 50 / 56 CC 5 SCAR 6.3
CC
5
Cov
89%
__ANON__
3.1
__ANON__
2.1
__ANON__
2.0
CRAP 1.9
« Resume/Output/ToPlain.pm ↑ Summary Resume.pm »
1 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Acme::Resume::MoopsParserTrait;
5  
6 2 our $VERSION = '0.0102'; # VERSION
7 # ABSTRACT: Trait for the Moops parser
8  
9 2 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Module::Runtime qw($module_name_rx);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 around _eat_package => sub {
13 1 ▶ my $next = shift;
Subroutine __ANON__: called CC=2 SCAR=7.0
14 1 my $self = shift;
15 1 my ($rel) = @_;
16  
17 1 my $pkg = $self->_eat(qr{(?:::)?$module_name_rx});
18  
19 1 ▶ if($pkg !~ m{::}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($pkg =~ /::/) 1 0 1
20 1 $pkg = 'Acme::Resume::For::' . $pkg;
21 }
22  
23 1 return $self->qualify_module_name($pkg, $rel);
24  
25 2 };
26  
27 after parse => sub {
28 1 ▶ my $self = shift;
Subroutine __ANON__: called CC=3 SCAR=11.4
29  
30 1 ▶ if($self->keyword eq 'resume') {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->keyword eq "resume") 1 0 1
31 1 ▶ push @{ $self->relations->{'with'} ||= [] } => (
Condition50%1/2
$self->relations->{"with"} ||= []
l!l
01
MC/DC0%0/1
$self->relations->{"with"} ||= []
$self->relations->{"with"}
Truth table50%1/2
A
A= $self->relations->{"with"}
Aresult
11
00
32 'Acme::Resume::Output::ToPlain',
33 );
34 }
35 2 };
36  
37 around keywords => sub {
38 2 ▶ my $next = shift;
Subroutine __ANON__: called CC=1 SCAR=0.0
39 2 my $self = shift;
40  
41 2 my @all = ('resume', $self->$next(@_));
42 2 return @all;
43 2 };
44  
45 around class_for_keyword => sub {
46 1 ▶ my $next = shift;
Subroutine __ANON__: called CC=2 SCAR=7.2
47 1 my $self = shift;
48  
49 1 ▶ if($self->keyword eq 'resume') {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->keyword eq "resume") 1 0 1
50 1 require Moops::Keyword::Class;
51 1 return 'Moops::Keyword::Class';
52 }
53  
54 0 return $self->$next(@_);
55 2 };
56  
57 2 1;
58  
59 __END__
60  
61 =pod
62  
63 =encoding UTF-8
64  
65 =head1 NAME
66  
67 Acme::Resume::MoopsParserTrait - Trait for the Moops parser
68  
69 =head1 VERSION
70  
71 Version 0.0102, released 2016-01-27.
72  
73 =head1 SOURCE
74  
75 L<https://github.com/Csson/p5-Acme-Resume>
76  
77 =head1 HOMEPAGE
78  
79 L<https://metacpan.org/release/Acme-Resume>
80  
81 =head1 AUTHOR
82  
83 Erik Carlsson <info@code301.com>
84  
85 =head1 COPYRIGHT AND LICENSE
86  
87 This software is copyright (c) 2016 by Erik Carlsson.
88  
89 This is free software; you can redistribute it and/or modify it under
90 the same terms as the Perl 5 programming language system itself.
91  
92 =cut
« Resume/Output/ToPlain.pm ↑ Summary Resume.pm »