« Data/Sah/Value/perl/Path/curdir_abs.pm
↑ Summary
Data/Sah/Value/perl/Path/only_file_in_curdir.pm »
| 1 | package Data::Sah::Value::perl::Path::newest_file_in_curdir; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use 5.010001; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |||||||||||
| 8 | 1 | our $DATE = '2024-02-16'; # DATE | |||||||||||
| 9 | 1 | our $DIST = 'Sah-SchemaBundle-Path'; # DIST | |||||||||||
| 10 | 1 | our $VERSION = '0.031'; # VERSION | |||||||||||
| 11 | |||||||||||||
| 12 | 0 | ▶ | sub meta { | ||||||||||
|
Subroutine
meta: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 13 | +{ | ||||||||||||
| 14 | 0 | v => 1, | |||||||||||
| 15 | summary => 'Newest file in current directory', | ||||||||||||
| 16 | description => <<'MARKDOWN', | ||||||||||||
| 17 | |||||||||||||
| 18 | This default value rule will return filename if there is a plain file in the | ||||||||||||
| 19 | current directory. See <pm:File::Util::Sort>'s `newest`. | ||||||||||||
| 20 | |||||||||||||
| 21 | MARKDOWN | ||||||||||||
| 22 | args => { | ||||||||||||
| 23 | }, | ||||||||||||
| 24 | }; | ||||||||||||
| 25 | } | ||||||||||||
| 26 | |||||||||||||
| 27 | 0 | ▶ | sub value { | ||||||||||
|
Subroutine
value: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||
| 28 | 0 | my %cargs = @_; | |||||||||||
| 29 | |||||||||||||
| 30 | 0 | ▶ | my $gen_args = $cargs{args} // {}; | ||||||||||
|
Condition0%0/2
$cargs{"args"} // {}
MC/DC0%0/1
$cargs{"args"} // {}
$cargs{"args"}
Truth table0%0/2
A
A= $cargs{"args"}
| |||||||||||||
| 31 | 0 | my $res = {}; | |||||||||||
| 32 | |||||||||||||
| 33 | 0 | ▶ | $res->{modules}{"File::Util::Sort"} //= 0; | ||||||||||
|
Condition0%0/2
$res->{"modules"}{"File::Util::Sort"} //= 0
MC/DC0%0/1
$res->{"modules"}{"File::Util::Sort"} //= 0
$res->{"modules"}{"File::Util::Sort"}
Truth table0%0/2
A
A= $res->{"modules"}{"File::Util::Sort"}
| |||||||||||||
| 34 | |||||||||||||
| 35 | 0 | $res->{expr_value} = join( | |||||||||||
| 36 | '', | ||||||||||||
| 37 | 'do { ', ( | ||||||||||||
| 38 | 'my $res = File::Util::Sort::newest(type=>"file"); ', | ||||||||||||
| 39 | 'warn "Cannot find newest file: $res->[0] - $res->[1]" unless $res->[0] == 200; ', | ||||||||||||
| 40 | '$res->[2][0] ', | ||||||||||||
| 41 | ), | ||||||||||||
| 42 | '}', | ||||||||||||
| 43 | ); | ||||||||||||
| 44 | |||||||||||||
| 45 | 0 | $res; | |||||||||||
| 46 | } | ||||||||||||
| 47 | |||||||||||||
| 48 | 1 | 1; | |||||||||||
| 49 | # ABSTRACT: | ||||||||||||
| 50 | |||||||||||||
| 51 | __END__ | ||||||||||||