Sah/Schema/perl/distname_with_ver.pm

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 14 / 14 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Sah/Schema/perl/distname_with_optional_ver.pm ↑ Summary Sah/Schema/perl/funcname.pm »
1 package Sah::Schema::perl::distname_with_ver;
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 = [str => {
12 summary => 'Perl distribution name with version number suffix, e.g. Foo-Bar@0.001',
13 match => '\A[A-Za-z_][A-Za-z_0-9]*(-[A-Za-z_0-9]+)*@[0-9][0-9A-Za-z]*(\\.[0-9A-Za-z_]+)*\z',
14 'x.perl.coerce_rules' => [
15 'From_str::normalize_perl_distname',
16 ],
17  
18 # provide a default completion which is from list of installed perl distributions
19 'x.completion' => 'perl_distname',
20  
21  
22 description => <<'_',
23  
24 For convenience (particularly in CLI with tab completion), you can input one of:
25  
26 Foo::Bar@1.23
27 Foo/Bar@1.23
28 Foo/Bar.pm@1.23
29 Foo.Bar@1.23
30  
31 and it will be coerced into Foo-Bar form.
32  
33 _
34  
35 examples => [
36 {value=>'', valid=>0},
37 {value=>'Foo-Bar', valid=>0},
38 {value=>'Foo::Bar', valid=>0},
39 {value=>'Foo-Bar@1.0.0', valid=>1},
40 {value=>'Foo::Bar@1.0.0', valid=>1, validated_value=>'Foo-Bar@1.0.0'},
41 {value=>'Foo-Bar@0.5_001', valid=>1},
42 {value=>'Foo::Bar@0.5_001', valid=>1, validated_value=>'Foo-Bar@0.5_001'},
43 {value=>'Foo-Bar@a', valid=>0},
44 ],
45  
46 }];
47  
48 1 1;
49 # ABSTRACT: Perl distribution name with version number suffix, e.g. Foo-Bar@0.001
50  
51 __END__
« Sah/Schema/perl/distname_with_optional_ver.pm ↑ Summary Sah/Schema/perl/funcname.pm »