« IsDev/NegativeHeuristic/HomeDir.pm
↑ Summary
IsDev/Role/Matcher/Child/BaseName/MatchRegexp/File.pm »
| 1 | 14 | ▶ | use 5.008; # utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 14 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 14 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 14 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | package Path::IsDev::Role::HeuristicSet; | ||||||||||
| 7 | |||||||||||
| 8 | 14 | our $VERSION = '1.001003'; | |||||||||
| 9 | |||||||||||
| 10 | # ABSTRACT: Role for sets of Heuristics. | ||||||||||
| 11 | |||||||||||
| 12 | 14 | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | |||||||||
| 13 | |||||||||||
| 14 | |||||||||||
| 15 | |||||||||||
| 16 | |||||||||||
| 17 | |||||||||||
| 18 | |||||||||||
| 19 | |||||||||||
| 20 | |||||||||||
| 21 | |||||||||||
| 22 | |||||||||||
| 23 | |||||||||||
| 24 | |||||||||||
| 25 | 127 | ▶ | sub _use_module { require Module::Runtime; goto &Module::Runtime::use_module } | ||||||||
|
Subroutine
_use_module: called CC=1 SCAR=0.0
| |||||||||||
| 26 | 208 | ▶ | sub _com_mn { require Module::Runtime; goto &Module::Runtime::compose_module_name; } | ||||||||
|
Subroutine
_com_mn: called CC=1 SCAR=0.0
| |||||||||||
| 27 | ## no critic (Subroutines::ProhibitCallsToUnexportedSubs) | ||||||||||
| 28 | 13 | ▶ | sub _debug { require Path::IsDev; goto &Path::IsDev::debug } | ||||||||
|
Subroutine
_debug: called CC=1 SCAR=0.0
| |||||||||||
| 29 | |||||||||||
| 30 | 14 | ▶ | use Role::Tiny qw( requires ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 31 | |||||||||||
| 32 | |||||||||||
| 33 | |||||||||||
| 34 | |||||||||||
| 35 | |||||||||||
| 36 | |||||||||||
| 37 | |||||||||||
| 38 | 14 | requires 'modules'; | |||||||||
| 39 | |||||||||||
| 40 | 160 | ▶ | sub _expand_heuristic { | ||||||||
|
Subroutine
_expand_heuristic: called CC=1 SCAR=0.0
| |||||||||||
| 41 | 160 | my ( undef, $hn ) = @_; | |||||||||
| 42 | 160 | return _com_mn( 'Path::IsDev::Heuristic', $hn ); | |||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 48 | ▶ | sub _expand_negative_heuristic { | ||||||||
|
Subroutine
_expand_negative_heuristic: called CC=1 SCAR=0.0
| |||||||||||
| 46 | 48 | my ( undef, $hn ) = @_; | |||||||||
| 47 | 48 | return _com_mn( 'Path::IsDev::NegativeHeuristic', $hn ); | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 127 | ▶ | sub _load_module { | ||||||||
|
Subroutine
_load_module: called CC=1 SCAR=0.0
| |||||||||||
| 51 | 127 | my ( undef, $module ) = @_; | |||||||||
| 52 | 127 | return _use_module($module); | |||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | |||||||||||
| 56 | |||||||||||
| 57 | |||||||||||
| 58 | |||||||||||
| 59 | |||||||||||
| 60 | |||||||||||
| 61 | |||||||||||
| 62 | |||||||||||
| 63 | |||||||||||
| 64 | |||||||||||
| 65 | 16 | ▶ | sub matches { | ||||||||
|
Subroutine
matches: called CC=5 SCAR=16.3
Pod
documented
| |||||||||||
| 66 | 16 | my ( $self, $result_object ) = @_; | |||||||||
| 67 | 16 | TESTS: for my $module ( $self->modules ) { | |||||||||
| 68 | 127 | $self->_load_module($module); | |||||||||
| 69 | 127 | ▶ | if ( $module->can('excludes') ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 70 | 48 | ▶ | if ( $module->excludes($result_object) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 71 | 0 | _debug( $module->name . q[ excludes path ] . $result_object->path ); | |||||||||
| 72 | 0 | return; | |||||||||
| 73 | } | ||||||||||
| 74 | 48 | next TESTS; | |||||||||
| 75 | } | ||||||||||
| 76 | 79 | ▶ | next unless $module->matches($result_object); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 77 | 13 | my $name = $module->name; | |||||||||
| 78 | 13 | _debug( $name . q[ matched path ] . $result_object->path ); | |||||||||
| 79 | 13 | return 1; | |||||||||
| 80 | } | ||||||||||
| 81 | 3 | return; | |||||||||
| 82 | } | ||||||||||
| 83 | |||||||||||
| 84 | 14 | 1; | |||||||||
| 85 | |||||||||||
| 86 | __END__ | ||||||||||