| 1 | 12 | ▶ | use 5.008; # utf8 | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 2 | 12 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 12 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 12 | ▶ | use utf8; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | package Path::IsDev; | ||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 12 | our $VERSION = '1.001003'; | |||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | # ABSTRACT: Determine if a given Path resembles a development source tree | ||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 12 | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | |||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 12 | ▶ | use Sub::Exporter -setup => { exports => [ is_dev => \&_build_is_dev, ], }; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 12 | our $ENV_KEY_DEBUG = 'PATH_ISDEV_DEBUG'; | |||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | 12 | ▶ | our $DEBUG = ( exists $ENV{$ENV_KEY_DEBUG} ? $ENV{$ENV_KEY_DEBUG} : undef ); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | 0 | ▶ | sub debug { | ||||||||||||||||||
|
Subroutine
debug: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 42 | 0 | ▶ | return unless $DEBUG; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 43 | 0 | return *STDERR->printf( qq{[Path::IsDev] %s\n}, shift ); | |||||||||||||||||||
| 44 | } | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | 21 | ▶ | sub _build_is_dev { | ||||||||||||||||||
|
Subroutine
_build_is_dev: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 47 | 21 | my ( undef, undef, $arg ) = @_; | |||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 21 | my $isdev_object; | |||||||||||||||||||
| 50 | 10 | ▶ | return sub { | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.2
| |||||||||||||||||||||
| 51 | 10 | my ($path) = @_; | |||||||||||||||||||
| 52 | 10 | ▶ | $isdev_object ||= do { | ||||||||||||||||||
|
Condition66%2/3
$isdev_object ||= do {
require Path::IsDev::Object;
"Path::IsDev::Object"->new(%{$arg or {};})
}
MC/DC0%0/2
$isdev_object ||= do {
require Path::IsDev::Object;
"Path::IsDev::Object"->new(%{$arg or {};})
}
$isdev_object
do {
require Path::IsDev::Object;
"Path::IsDev::Object"->new(%{$arg or {};})
}
Truth table66%2/3
A ||= B
A= $isdev_objectB= do {
require Path::IsDev::Object;
"Path::IsDev::Object"->new(%{$arg or {};})
}
| |||||||||||||||||||||
| 53 | 9 | require Path::IsDev::Object; | |||||||||||||||||||
| 54 | 9 | ▶ | Path::IsDev::Object->new( %{ $arg || {} } ); | ||||||||||||||||||
|
Condition50%1/2
$arg || {}
MC/DC0%0/1
$arg || {}
$arg
Truth table50%1/2
A
A= $arg
| |||||||||||||||||||||
| 55 | }; | ||||||||||||||||||||
| 56 | 10 | return $isdev_object->matches($path); | |||||||||||||||||||
| 57 | 21 | }; | |||||||||||||||||||
| 58 | } | ||||||||||||||||||||
| 59 | |||||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | |||||||||||||||||||||
| 64 | |||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | |||||||||||||||||||||
| 67 | |||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | |||||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | |||||||||||||||||||||
| 73 | |||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | |||||||||||||||||||||
| 76 | |||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | |||||||||||||||||||||
| 80 | |||||||||||||||||||||
| 81 | |||||||||||||||||||||
| 82 | |||||||||||||||||||||
| 83 | 12 | *is_dev = _build_is_dev( 'Path::IsDev', 'is_dev', {} ); | |||||||||||||||||||
| 84 | |||||||||||||||||||||
| 85 | 12 | 1; | |||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | __END__ | ||||||||||||||||||||