| 1 | package Sah::Schema::perl::modprefixes; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |
| 7 | 1 | our $DATE = '2024-02-16'; # DATE | |
| 8 | 1 | our $DIST = 'Sah-SchemaBundle-Perl'; # DIST | |
| 9 | 1 | our $VERSION = '0.050'; # VERSION | |
| 10 | |||
| 11 | 1 | our $schema = [array => { | |
| 12 | summary => 'Perl module prefixes, e.g. ["", "Foo::", "Foo::Bar::"]', | ||
| 13 | description => <<'_', | ||
| 14 | |||
| 15 | Array of Perl module prefixes, where each element is of `perl::modprefix` | ||
| 16 | schema, e.g. `Foo::`, `Foo::Bar::`. | ||
| 17 | |||
| 18 | Contains coercion rule that expands wildcard, so you can specify: | ||
| 19 | |||
| 20 | Module::C* | ||
| 21 | |||
| 22 | and it will be expanded to e.g.: | ||
| 23 | |||
| 24 | ["Module::CPANTS::", "Module::CPANfile::", "Module::CheckVersion::", "Module::CoreList::"] | ||
| 25 | |||
| 26 | The wildcard syntax supports jokers (`?`, '*`) and brackets (`[abc]`). See the | ||
| 27 | `unix` type of wildcard in <pm:Regexp::Wildcards>, which this coercion rule | ||
| 28 | uses. | ||
| 29 | |||
| 30 | _ | ||
| 31 | of => ["perl::modprefix", {req=>1}, {}], | ||
| 32 | |||
| 33 | 'x.perl.coerce_rules' => [ | ||
| 34 | 'From_str_or_array::expand_perl_modprefix_wildcard', | ||
| 35 | ], | ||
| 36 | |||
| 37 | # provide a default completion which is from list of installed perl modules | ||
| 38 | 'x.element_completion' => 'perl_modprefix', | ||
| 39 | |||
| 40 | }]; | ||
| 41 | |||
| 42 | 1 | 1; | |
| 43 | # ABSTRACT: Perl module prefixes, e.g. ["", "Foo::", "Foo::Bar::"] | ||
| 44 | |||
| 45 | __END__ | ||