Sah/SchemaR/perl/filename.pm

filter: Statementstmt 62.9% 17 / 27 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod n/a totaltotal 60.6% 20 / 33 CC 2 SCAR 5.2
CC
2
Cov
59%
__ANON__
2.6
BEGIN
1.1
BEGIN
1.1
CRAP 1.7
« Data/Sah/Value/perl/Perl/this_mod.pm ↑ Summary Sah/SchemaR/perl/pm_filename.pm »
1 ## no critic: TestingAndDebugging::RequireStrict
2 package Sah::SchemaR::perl::filename;
3  
4 # preamble code
5 1 ▶no warnings 'experimental::regex_sets';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 our $DATE = '2024-02-16'; # DATE
8 1 our $VERSION = '0.050'; # VERSION
9  
10 0 ▶our $rschema = do{my$var={base=>"str",clsets_after_base=>[{description=>"\nUse this schema if you want to accept a filesystem path containing Perl script,\nmodule, or POD. The value of this schema is in the convenience of CLI\ncompletion, as well as coercion from script or module name.\n\nString containing filename of a Perl script or module or POD. For convenience,\nwhen value is in the form of:\n\n Foo\n Foo.pm\n Foo.pod\n Foo::Bar\n Foo/Bar\n Foo/Bar.pm\n Foo/Bar.pod\n\nand a matching .pod or .pm file is found in `\@INC`, then it will be coerced\n(converted) into the path of that .pod/.pm file, e.g.:\n\n /home/ujang/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Foo/Bar.pm\n lib/Foo/Bar.pod\n\nTo prevent such coercion, you can use prefixing path, e.g.:\n\n ./Foo::Bar\n ../Foo/Bar\n /path/to/Foo/Bar\n\nThis schema comes with convenience completion too.\n\n",summary=>"Filename of Perl script/module/POD, e.g. /path/Foo/Bar.pm","x.completion"=>sub{package Sah::Schema::perl::filename;use warnings;use strict;require Complete::File;require Complete::Module;require Complete::Util;my(%args) = @_;my $word = $args{'word'};my @answers;push @answers, Complete::File::complete_file('word', $word);if ($word =~ m[\A\w*((?:::|/)\w+)*\z]) {push @answers, Complete::Module::complete_module('word', $word);}Complete::Util::combine_answers(@answers)},"x.perl.coerce_rules"=>["From_str::convert_perl_pm_or_pod_to_path"]}],clsets_after_type=>['$var->{clsets_after_base}[0]'],"clsets_after_type.alt.merge.merged"=>['$var->{clsets_after_base}[0]'],resolve_path=>["str"],type=>"str",v=>2};$var->{clsets_after_type}[0]=$var->{clsets_after_base}[0];$var->{"clsets_after_type.alt.merge.merged"}[0]=$var->{clsets_after_base}[0];$var};
Subroutine BEGIN: called CC=1 SCAR=1.3
Subroutine BEGIN: called CC=1 SCAR=1.3
Subroutine __ANON__: not called CC=2 SCAR=9.4
Branch: 1 branch
BranchTrueFalseTotal
if ($word =~ m[\A\w*((?:::|/)\w+)*\z]) 0 0 0
11  
12 1 1;
13 # ABSTRACT: Filename of Perl script/module/POD, e.g. /path/Foo/Bar.pm
14  
15 __END__
« Data/Sah/Value/perl/Perl/this_mod.pm ↑ Summary Sah/SchemaR/perl/pm_filename.pm »