| 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
| |||||||||||
| 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
| |||||||||||
| 42 | 51 | my ( $func, $args ) = ( shift @args, shift @args ); | |||||||||
| 43 | 51 | ▶ | $args = [$args] if ref $args ne "ARRAY"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 44 | 51 | $class->can( $func )->( @{$args} ); | |||||||||
| 45 | } | ||||||||||
| 46 | 26 | return; | |||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | 9 | 1; | |||||||||
| 50 | |||||||||||
| 51 | __END__ | ||||||||||