Sah/SchemaR/perl/modname.pm

filter: Statementstmt 100% 11 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 1 / 1 Podpod n/a totaltotal 100% 12 / 12 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
CRAP 1.0
« Sah/SchemaR/perl/modargs.pm ↑ Summary Sah/SchemaR/perl/modname/default_this_mod.pm »
1 ## no critic: TestingAndDebugging::RequireStrict
2 package Sah::SchemaR::perl::modname;
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 1 our $rschema = do{my$var={base=>"str",clsets_after_base=>[{description=>"\nThis is a schema you can use when you want to accept a Perl module name. It\noffers basic checking of syntax as well as a couple of conveniences. First, it\noffers completion from list of locally installed Perl modules. Second, it\ncontains coercion rule so you can also input `Foo-Bar`, `Foo/Bar`, `Foo/Bar.pm`\nor even 'Foo.Bar' and it will be normalized into `Foo::Bar`.\n\nTo see this schema in action on the CLI, you can try e.g. the `pmless` script\nfrom <pm:App::PMUtils> and activate its tab completion (see its manpage for more\ndetails). Then on the CLI try typing:\n\n % pmless M/<tab>\n % pmless dzp/<tab>\n % pmless Module/List/Wildcard\n % pmless Module::List::Wildcard\n\nNote that this schema does not check that the Perl module exists or is installed\nlocally. To check that, use the `perl::modname::installed` schema. And there's\nalso a `perl::modname::not_installed` schema.\n\n",examples=>[{valid=>0,value=>""},{valid=>1,value=>"Foo::Bar"},{valid=>1,validated_value=>"Foo::Bar",value=>"Foo-Bar"},{valid=>1,validated_value=>"Foo::Bar",value=>"Foo/Bar"},{valid=>1,validated_value=>"Foo::Bar",value=>"Foo//Bar"},{valid=>1,validated_value=>"Foo::Bar",value=>"Foo/Bar.pm"},{valid=>1,validated_value=>"Foo::Bar",value=>"Foo.Bar"},{valid=>0,value=>"Foo|Bar"}],match=>"\\A(?:[A-Za-z_][A-Za-z_0-9]*(::[A-Za-z_0-9]+)*)\\z",prefilters=>["Perl::normalize_perl_modname"],summary=>"Perl module name, e.g. Foo::Bar","x.completion"=>"perl_modname"}],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};
11  
12 1 1;
13 # ABSTRACT: Perl module name, e.g. Foo::Bar
14  
15 __END__
« Sah/SchemaR/perl/modargs.pm ↑ Summary Sah/SchemaR/perl/modname/default_this_mod.pm »