| 1 | package App::lcpan::Cmd::author_deps_by_dependent_count; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.010; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | require App::lcpan; | |||||||||
| 8 | 1 | require App::lcpan::Cmd::deps_by_dependent_count; | |||||||||
| 9 | |||||||||||
| 10 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |||||||||
| 11 | 1 | our $DATE = '2023-09-26'; # DATE | |||||||||
| 12 | 1 | our $DIST = 'App-lcpan'; # DIST | |||||||||
| 13 | 1 | our $VERSION = '1.074'; # VERSION | |||||||||
| 14 | |||||||||||
| 15 | 1 | our %SPEC; | |||||||||
| 16 | |||||||||||
| 17 | 1 | my $deps_bdc_args = $App::lcpan::Cmd::deps_by_dependent_count::SPEC{handle_cmd}{args}; | |||||||||
| 18 | |||||||||||
| 19 | $SPEC{'handle_cmd'} = { | ||||||||||
| 20 | v => 1.1, | ||||||||||
| 21 | summary => 'List all dependencies of dists of an author, sorted by number of dependent dists', | ||||||||||
| 22 | args => { | ||||||||||
| 23 | 11 | (map {$_ => $deps_bdc_args->{$_}} | |||||||||
| 24 | 1 | grep {$_ ne 'modules'} keys %$deps_bdc_args), | |||||||||
| 25 | %App::lcpan::author_args, | ||||||||||
| 26 | module_authors => { | ||||||||||
| 27 | 'x.name.is_plural' => 1, | ||||||||||
| 28 | 'x.name.singular' => 'module_author', | ||||||||||
| 29 | schema => ['array*', of=>'str*', min_len=>1], | ||||||||||
| 30 | tags => ['category:filtering'], | ||||||||||
| 31 | element_completion => \&App::lcpan::_complete_cpanid, | ||||||||||
| 32 | }, | ||||||||||
| 33 | module_authors_arent => { | ||||||||||
| 34 | 'x.name.is_plural' => 1, | ||||||||||
| 35 | 'x.name.singular' => 'module_author_isnt', | ||||||||||
| 36 | schema => ['array*', of=>'str*', min_len=>1], | ||||||||||
| 37 | tags => ['category:filtering'], | ||||||||||
| 38 | element_completion => \&App::lcpan::_complete_cpanid, | ||||||||||
| 39 | }, | ||||||||||
| 40 | }, | ||||||||||
| 41 | tags => [], | ||||||||||
| 42 | }; | ||||||||||
| 43 | 0 | ▶ | sub handle_cmd { | ||||||||
|
Subroutine
handle_cmd: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 44 | 0 | my %args = @_; | |||||||||
| 45 | |||||||||||
| 46 | 0 | my $res = App::lcpan::modules(%args); | |||||||||
| 47 | 0 | ▶ | return $res if $res->[0] != 200; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | |||||||||||
| 49 | 0 | my %deps_bdc_args = %args; | |||||||||
| 50 | |||||||||||
| 51 | 0 | delete $deps_bdc_args{author}; | |||||||||
| 52 | 0 | $deps_bdc_args{modules} = $res->[2]; | |||||||||
| 53 | |||||||||||
| 54 | 0 | delete $deps_bdc_args{module_authors}; | |||||||||
| 55 | 0 | $deps_bdc_args{authors} = $args{module_authors}; | |||||||||
| 56 | |||||||||||
| 57 | 0 | delete $deps_bdc_args{module_authors_arent}; | |||||||||
| 58 | 0 | $deps_bdc_args{authors_arent} = $args{module_authors_arent}; | |||||||||
| 59 | |||||||||||
| 60 | 0 | App::lcpan::Cmd::deps_by_dependent_count::handle_cmd(%deps_bdc_args); | |||||||||
| 61 | } | ||||||||||
| 62 | |||||||||||
| 63 | 1 | 1; | |||||||||
| 64 | # ABSTRACT: List all dependencies of dists of an author, sorted by number of dependent dists | ||||||||||
| 65 | |||||||||||
| 66 | __END__ | ||||||||||