| 1 | ## no critic: TestingAndDebugging::RequireStrict | ||
| 2 | package Sah::SchemaR::perl::modname::default_this_mod; | ||
| 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=>"perl::modname",clsets_after_base=>[{description=>"\nSee <pm:App::ThisDist>'s `this_mod()` for more details on how \"this module\" is\ndetermined. Note that `App::ThisDist` is not added as dependency automatically;\nyou will have to add it manually.\n\nNote: be careful when using this schema for actions that are destructive to a\nPerl module or that change some things, because a user can perform those actions\nwithout giving an argument (e.g. a `delete-module` script). It is safer to use\nthis schema to perform a non=destructive action (e.g. `man-module`) and/or\noperate in dry-run mode by default.\n\n",examples=>[],summary=>"Perl module, defaults to \"this module\"","x.perl.default_value_rules"=>["Perl::this_mod"]}],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}; | |
| 11 | |||
| 12 | 1 | 1; | |
| 13 | # ABSTRACT: Perl module, defaults to "this module" | ||
| 14 | |||
| 15 | __END__ | ||