File Coverage

blib/lib/Sort/Sub/rinci_meta_prop.pm
Criterion Covered Total %
statement 8 14 57.1
branch n/a
condition n/a
subroutine 3 7 42.8
pod 0 2 0.0
total 11 23 47.8


line stmt bran cond sub pod time code
1             package Sort::Sub::rinci_meta_prop;
2              
3 1     1   326035 use 5.010001;
  1         3  
4 1     1   3 use strict;
  1         2  
  1         23  
5 1     1   3 use warnings;
  1         1  
  1         280  
6              
7             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
8             our $DATE = '2024-01-12'; # DATE
9             our $DIST = 'Sort-SubBundle-Rinci'; # DIST
10             our $VERSION = '0.001'; # VERSION
11              
12             sub meta {
13             return {
14 0     0 0   v => 1,
15             summary => 'Sort Rinci metadata properties (and attributes)',
16             };
17             }
18              
19             sub gen_sorter {
20 0     0 0   require Sort::BySpec;
21              
22 0           my ($is_reverse, $is_ci) = @_;
23              
24             Sort::BySpec::cmp_by_spec(
25             spec => [
26             # from defhash
27             'v',
28              
29             # from defhash
30             'defhash_v',
31              
32             'entity_v',
33              
34             # from defhash
35             'default_lang',
36              
37             # from defhash
38             'name',
39             qr/\Aname\./,
40              
41             # from defhash
42             'caption',
43             qr/\Acaption\./,
44              
45             # from defhash
46             'summary',
47             qr/\Asummary\./,
48              
49             # from defhash
50             'description',
51             qr/\Adescription\./,
52              
53             # from defhash
54             'tags',
55              
56             'links',
57              
58             'x',
59 0     0     qr/\Ax\./ => sub { $_[0] cmp $_[1] },
60              
61 0     0     qr// => sub { $_[0] cmp $_[1] },
62 0           ],
63             reverse => $is_reverse,
64             );
65             }
66              
67             1;
68             # ABSTRACT: Sort Rinci metadata properties (and attributes)
69              
70             __END__