| 1 | package App::SortSubUtils; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |||||||||
| 4 | 1 | our $DATE = '2019-12-15'; # DATE | |||||||||
| 5 | 1 | our $DIST = 'App-SortSubUtils'; # DIST | |||||||||
| 6 | 1 | our $VERSION = '0.003'; # VERSION | |||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use 5.010001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use strict 'subs', 'vars'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 1 | our %SPEC; | |||||||||
| 13 | |||||||||||
| 14 | $SPEC{list_sort_sub_modules} = { | ||||||||||
| 15 | 1 | v => 1.1, | |||||||||
| 16 | args => { | ||||||||||
| 17 | detail => { | ||||||||||
| 18 | schema => 'bool*', | ||||||||||
| 19 | cmdline_aliases => {l=>{}}, | ||||||||||
| 20 | }, | ||||||||||
| 21 | }, | ||||||||||
| 22 | }; | ||||||||||
| 23 | 0 | ▶ | sub list_sort_sub_modules { | ||||||||
|
Subroutine
list_sort_sub_modules: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 24 | 0 | require Module::List::Tiny; | |||||||||
| 25 | |||||||||||
| 26 | 0 | my %args = @_; | |||||||||
| 27 | |||||||||||
| 28 | 0 | my $mods = Module::List::Tiny::list_modules( | |||||||||
| 29 | "Sort::Sub::", {list_modules=>1, recurse=>1}); | ||||||||||
| 30 | 0 | my @rows; | |||||||||
| 31 | 0 | for my $mod (sort keys %$mods) { | |||||||||
| 32 | 0 | (my $name = $mod) =~ s/^Sort::Sub:://; | |||||||||
| 33 | 0 | ▶ | if ($args{detail}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | 0 | (my $mod_pm = "$mod.pm") =~ s!::!/!g; | |||||||||
| 35 | 0 | require $mod_pm; | |||||||||
| 36 | 0 | my $meta = {}; | |||||||||
| 37 | 0 | eval { | |||||||||
| 38 | 0 | $meta = &{"$mod\::meta"}; | |||||||||
| 39 | }; | ||||||||||
| 40 | push @rows, { | ||||||||||
| 41 | name => $name, | ||||||||||
| 42 | summary => $meta->{summary}, | ||||||||||
| 43 | 0 | }; | |||||||||
| 44 | } else { | ||||||||||
| 45 | 0 | push @rows, $name; | |||||||||
| 46 | } | ||||||||||
| 47 | } | ||||||||||
| 48 | 0 | [200, "OK", \@rows]; | |||||||||
| 49 | } | ||||||||||
| 50 | |||||||||||
| 51 | 1 | 1; | |||||||||
| 52 | # ABSTRACT: CLIs related to Sort::Sub | ||||||||||
| 53 | |||||||||||
| 54 | __END__ | ||||||||||