blib/lib/lib/byversion.pm

filter: Statementstmt 93.9% 31 / 33 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 91.1% 41 / 45 CC 3 SCAR 3.6
CC
3
Cov
89%
import
2.1
unimport
2.1
BEGIN
1.0
CRAP 1.4
↑ Summary
1 4 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package lib::byversion;
6  
7 4 our $VERSION = '0.002002';
8  
9 # ABSTRACT: add paths to @INC depending on which version of Perl is running.
10  
11 4 our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
12  
13 4 ▶use lib ();
Subroutine BEGIN: called CC=1 SCAR=0.0
14 4 ▶use version 0.77;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 4 ▶use String::Formatter stringf => {
Subroutine BEGIN: called CC=1 SCAR=0.0
17 -as => path_format =>,
18 codes => {
19 v => "$]",
20 4 V => do {
21 4 my $x = version->parse("$]")->normal;
22 4 $x =~ s{^v}{}sx;
23 4 $x;
24 },
25 },
26 4 };
27  
28 2 ▶sub import {
Subroutine import: called CC=2 SCAR=7.4
29 2 my ( undef, @args ) = @_;
30 2 ▶ if ( @args != 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args != 1) 0 2 2
31 0 die 'lib::byversion->import takes exactly one argument, instead, you specified ' . scalar @args;
32 }
33 2 my $path = path_format(@args);
34 2 return lib->import($path);
35 }
36  
37 ## no critic (ProhibitBuiltinHomonyms)
38 1 ▶sub unimport {
Subroutine unimport: called CC=2 SCAR=7.4
39 1 my ( undef, @args ) = @_;
40 1 ▶ if ( @args != 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args != 1) 0 1 1
41 0 die 'lib::byversion->unimport takes exactly one argument, instead, you specified ' . scalar @args;
42 }
43 1 my $path = path_format(@args);
44 1 return lib->unimport($path);
45 }
46  
47 4 1;
48  
49 __END__
↑ Summary