SchemaR/cpan/distname.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
« SchemaBundle/CPAN.pm ↑ Summary SchemaR/cpan/modname.pm »
1 ## no critic: TestingAndDebugging::RequireStrict
2 package Sah::SchemaR::cpan::distname;
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::distname",clsets_after_base=>[{description=>"\nThis schema can be used to validate a CPAN distribution name. It's like the\n`perl::distname` schema, but with completion from distribution names on CPAN\n(using <prog:lcpan>). It does not check whether a CPAN distribution exists or\nnot (indexed on PAUSE); use the `cpan::distname::exists` or\n`cpan::distname::not_exists` schemas for 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 distribution name on CPAN, e.g. \"Module-Installed-Tiny\"","x.completion"=>["lcpan_distname"]}],clsets_after_type=>[{description=>"\nThis is a schema you can use when you want to accept a Perl distribution name,\ne.g. `WWW-Mechanize`. It offers basic checking of syntax as well as a couple of\nconveniences. First, it offers completion from list of locally installed Perl\ndistribution. Second, it contains coercion rule so you can also input\n`Foo::Bar`, `Foo/Bar`, `Foo/Bar.pm`, or even 'Foo.Bar' and it will be normalized\ninto `Foo-Bar`.\n\nTo see this schema in action on the CLI, you can try e.g. the `dist-has-deb`\nscript from <pm:App::DistUtils> and activate its tab completion (see its manpage\nfor more details). Then on the CLI try typing:\n\n % dist-has-deb WWW-<tab>\n % dist-has-deb dzp/<tab>\n\nNote that this schema does not check that the Perl disribution exists on CPAN or\nis installed locally. To check that, use the `perl::distname::installed` schema.\nAnd there's also a `perl::distname::not_installed` schema.\n\n",match=>"\\A[A-Za-z_][A-Za-z_0-9]*(-[A-Za-z_0-9]+)*\\z",summary=>"Perl distribution name, e.g. Foo-Bar","x.completion"=>"perl_distname","x.perl.coerce_rules"=>["From_str::normalize_perl_distname"]},'$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::distname"],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 distribution name on CPAN, e.g. "Module-Installed-Tiny"
11  
12 __END__
« SchemaBundle/CPAN.pm ↑ Summary SchemaR/cpan/modname.pm »