File Coverage

blib/lib/Sort/Sub/rinci_sub_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_sub_meta_prop;
2              
3 1     1   457963 use 5.010001;
  1         4  
4 1     1   7 use strict;
  1         3  
  1         32  
5 1     1   6 use warnings;
  1         3  
  1         463  
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 subroutine 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             # from Rinci meta
33             'entity_v',
34              
35             'is_func',
36             'is_meth',
37             'is_class_meth',
38              
39             # from defhash
40             'default_lang',
41              
42             # from defhash
43             'name',
44             qr/\Aname\./,
45              
46             # from defhash
47             'caption',
48             qr/\Acaption\./,
49              
50             # from defhash
51             'summary',
52             qr/\Asummary\./,
53              
54             # from defhash
55             'description',
56             qr/\Adescription\./,
57              
58             'args',
59              
60             'args_rels',
61              
62             'args_as',
63              
64             'result',
65              
66             'result_naked',
67              
68             'examples',
69              
70             'features',
71              
72             'deps',
73              
74             # from defhash
75             'tags',
76              
77             # from Rinci meta
78             'links',
79              
80             # from Rinci meta
81             'x',
82 0     0     qr/\Ax\./ => sub { $_[0] cmp $_[1] },
83              
84 0     0     qr// => sub { $_[0] cmp $_[1] },
85 0           ],
86             reverse => $is_reverse,
87             );
88             }
89              
90             1;
91             # ABSTRACT: Sort Rinci subroutine metadata properties (and attributes)
92              
93             __END__