SchemaR/cpan/modname.pm

filter: Statementstmt 100% 9 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 9 / 9 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« SchemaR/cpan/distname.pm ↑ Summary SchemaR/cpan/pause_id.pm »
1 ## no critic: TestingAndDebugging::RequireStrict
2 package Sah::SchemaR::cpan::modname;
3  
4 1 our $DATE = '2024-06-13'; # DATE
5 1 our $VERSION = '0.016'; # VERSION
6  
7 1 our $rschema = do{my$var={base=>"perl::modname",clsets_after_base=>[{description=>"\nThis schema can be used to validate a CPAN module name. It's like the\n`perl::modname` schema, but with completion from module names on CPAN (using\n<prog:lcpan>). It does not check whether a CPAN module exists or not (indexed on\nPAUSE); use the `cpan::modname::exists` or `cpan::modname::not_exists` schemas\nfor that purpose.\n\n",examples=>[{valid=>0,value=>""},{valid=>1,validated_value=>"Foo::Bar",value=>"Foo::Bar"},{valid=>1,validated_value=>"Foo::Bar",value=>"Foo-Bar"}],summary=>"A module name on CPAN, e.g. 'Module::Installed::Tiny'","x.completion"=>["lcpan_modname"]}],clsets_after_type=>[{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"},'$var->{clsets_after_base}[0]'],"clsets_after_type.alt.merge.merged"=>['$var->{clsets_after_type}[0]','$var->{clsets_after_base}[0]'],resolve_path=>["str","perl::modname"],type=>"str",v=>2};$var->{clsets_after_type}[1]=$var->{clsets_after_base}[0];$var->{"clsets_after_type.alt.merge.merged"}[0]=$var->{clsets_after_type}[0];$var->{"clsets_after_type.alt.merge.merged"}[1]=$var->{clsets_after_base}[0];$var};
8  
9 1 1;
10 # ABSTRACT: A module name on CPAN, e.g. 'Module::Installed::Tiny'
11  
12 __END__
« SchemaR/cpan/distname.pm ↑ Summary SchemaR/cpan/pause_id.pm »