| 1 | package Sah::Schema::cpan::pause_id; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | ▶ | use Regexp::Pattern::CPAN; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |
| 8 | 1 | our $DATE = '2024-06-13'; # DATE | |
| 9 | 1 | our $DIST = 'Sah-SchemaBundle-CPAN'; # DIST | |
| 10 | 1 | our $VERSION = '0.016'; # VERSION | |
| 11 | |||
| 12 | 1 | our $schema = ["str", { | |
| 13 | summary => "PAUSE author ID, e.g. 'PERLANCAR'", | ||
| 14 | match => qr/\A$Regexp::Pattern::CPAN::RE{pause_id}{pat}\z/, | ||
| 15 | 'x.perl.coerce_rules'=>['From_str::to_upper'], | ||
| 16 | 'x.completion'=>['lcpan_authorid'], | ||
| 17 | |||
| 18 | description => <<'MARKDOWN', | ||
| 19 | |||
| 20 | This schema can be used to validate a PAUSE ID. It's basically just `str` with | ||
| 21 | checks for valid characters and accepted length (2-9 characters). Whether the | ||
| 22 | PAUSE ID exists is not checked by this schema; see the `cpan::pause_id::exists` | ||
| 23 | and `cpan::pause_id::not_exists` for that purpose. | ||
| 24 | |||
| 25 | MARKDOWN | ||
| 26 | examples => [ | ||
| 27 | {value=>'', valid=>0}, | ||
| 28 | {value=>'perlancar', valid=>1, validated_value=>'PERLANCAR'}, | ||
| 29 | {value=>'perlancar2', valid=>0, summary=>'Too long'}, | ||
| 30 | ], | ||
| 31 | }]; | ||
| 32 | |||
| 33 | 1 | 1; | |
| 34 | |||
| 35 | # ABSTRACT: PAUSE author ID, e.g. 'PERLANCAR' | ||
| 36 | |||
| 37 | __END__ | ||