Data/Sah/Filter/perl/Path/check_path_not_exists.pm

filter: Statementstmt 68.4% 13 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 61.5% 16 / 26 CC 1 SCAR 3.4
CC
1
Cov
68%
meta
2.0
filter
2.0
BEGIN
1.0
CRAP 1.4
« Data/Sah/Filter/perl/Path/check_path_exists.pm ↑ Summary Data/Sah/Filter/perl/Path/expand_tilde.pm »
1 package Data::Sah::Filter::perl::Path::check_path_not_exists;
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 target_type => 'str',
16 summary => 'Check that path does not exist (using -e)',
17 might_fail => 1,
18 description => <<'MARKDOWN',
19  
20 This means that for a symlink, the target is checked and not the symlink itself.
21  
22 MARKDOWN
23 };
24 }
25  
26 0 ▶sub filter {
Subroutine filter: not called CC=1 SCAR=6.9
Pod undocumented
27 0 my %args = @_;
28  
29 0 my $dt = $args{data_term};
30  
31 0 my $res = {};
32  
33 0 $res->{expr_filter} = join(
34 "",
35 "do { my \$tmp = $dt; -e \$tmp ? [qq('\$tmp' must not already exist), \$tmp] : [undef,\$tmp] }",
36 );
37  
38 0 $res;
39 }
40  
41 1 1;
42 # ABSTRACT:
43  
44 __END__
« Data/Sah/Filter/perl/Path/check_path_exists.pm ↑ Summary Data/Sah/Filter/perl/Path/expand_tilde.pm »