MooX/BuildClass/Utils.pm

filter: Statementstmt 100% 23 / 23 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 2 / 2 totaltotal 100% 36 / 36 CC 4 SCAR 6.9
CC
4
Cov
100%
make_variant
3.0
make_variant_package_name
2.0
BEGIN
1.0
CRAP 2.0
« Constructor/Sugar.pm ↑ Summary MooX/SugarFactory.pm »
1 package MooX::BuildClass::Utils;
2  
3 9 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 9 ▶use Module::Runtime 'module_notional_filename';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 9 ▶use parent 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 9 our @EXPORT_OK = qw( make_variant_package_name make_variant );
10  
11 9 our $VERSION = '0.213360'; # VERSION
12  
13 # ABSTRACT: methods for MooX::BuildClass and MooX::BuildRole
14  
15 #
16 # This file is part of Throwable-SugarFactory
17 #
18 #
19 # Christian Walde has dedicated the work to the Commons by waiving all of his
20 # or her rights to the work worldwide under copyright law and all related or
21 # neighboring legal rights he or she had in the work, to the extent allowable by
22 # law.
23 #
24 # Works under CC0 do not require attribution. When citing the work, you should
25 # not imply endorsement by the author.
26 #
27  
28  
29 28 ▶sub make_variant_package_name {
Subroutine make_variant_package_name: called CC=2 SCAR=6.9
Pod documented
30 28 my ( undef, $name ) = @_;
31  
32 28 my $path = module_notional_filename $name;
33 28 ▶ die "Won't clobber already loaded: $path => $INC{$path}" if $INC{$path};
Branch: 1 branch
BranchTrueFalseTotal
if $INC{$path} 2 26 28
34  
35 26 return $name;
36 }
37  
38  
39 26 ▶sub make_variant {
Subroutine make_variant: called CC=3 SCAR=11.0
Pod documented
40 26 my ( $class, undef, undef, @args ) = @_;
41 26 ▶ while ( @args ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args) 51 26 77
42 51 my ( $func, $args ) = ( shift @args, shift @args );
43 51 ▶ $args = [$args] if ref $args ne "ARRAY";
Branch: 1 branch
BranchTrueFalseTotal
if ref $args ne "ARRAY" 11 40 51
44 51 $class->can( $func )->( @{$args} );
45 }
46 26 return;
47 }
48  
49 9 1;
50  
51 __END__
« Constructor/Sugar.pm ↑ Summary MooX/SugarFactory.pm »