| 1 | 1 | ▶ | use 5.006; # our | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | package Dist::Zilla::App::Command::listdeps_darkpan; | ||||||||||
| 6 | |||||||||||
| 7 | 1 | our $VERSION = 'v0.3.0'; | |||||||||
| 8 | |||||||||||
| 9 | 1 | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | |||||||||
| 10 | |||||||||||
| 11 | # FILENAME: listdeps_darkpan.pm | ||||||||||
| 12 | # CREATED: 30/10/11 11:07:09 by Kent Fredric (kentnl) <kentfredric@gmail.com> | ||||||||||
| 13 | # ABSTRACT: List DarkPAN dependencies | ||||||||||
| 14 | |||||||||||
| 15 | 1 | ▶ | use Dist::Zilla::App '-command'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | |||||||||||
| 18 | |||||||||||
| 19 | |||||||||||
| 20 | |||||||||||
| 21 | |||||||||||
| 22 | |||||||||||
| 23 | |||||||||||
| 24 | |||||||||||
| 25 | |||||||||||
| 26 | |||||||||||
| 27 | |||||||||||
| 28 | |||||||||||
| 29 | |||||||||||
| 30 | |||||||||||
| 31 | |||||||||||
| 32 | |||||||||||
| 33 | |||||||||||
| 34 | |||||||||||
| 35 | 0 | ▶ | sub abstract { return 'list your distributions prerequisites from darkpans' } ## no critic (ProhibitAmbiguousNames) | ||||||||
|
Subroutine
abstract: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 36 | |||||||||||
| 37 | 0 | ▶ | sub opt_spec { | ||||||||
|
Subroutine
opt_spec: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 38 | 0 | return [ 'missing', 'list only the missing dependencies' ],; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 0 | ▶ | sub _extract_dependencies { | ||||||||
|
Subroutine
_extract_dependencies: not called CC=8 SCAR=42.8
| |||||||||||
| 42 | 0 | my ( undef, $zilla, $missing ) = @_; | |||||||||
| 43 | 0 | $_->before_build for @{ $zilla->plugins_with('-BeforeBuild') }; | |||||||||
| 44 | 0 | $_->gather_files for @{ $zilla->plugins_with('-FileGatherer') }; | |||||||||
| 45 | 0 | $_->prune_files for @{ $zilla->plugins_with('-FilePruner') }; | |||||||||
| 46 | 0 | $_->munge_files for @{ $zilla->plugins_with('-FileMunger') }; | |||||||||
| 47 | 0 | $_->register_prereqs for @{ $zilla->plugins_with('-PrereqSource') }; | |||||||||
| 48 | 0 | my @dark; | |||||||||
| 49 | 0 | ▶ | my $callback = sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 50 | 0 | ▶ | shift @_ if 'HASH' eq ref $_[0]; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 51 | 0 | push @dark, @_; | |||||||||
| 52 | 0 | }; | |||||||||
| 53 | |||||||||||
| 54 | 0 | $_->register_external_prereqs($callback) for @{ $zilla->plugins_with('-PrereqSource::External') }; | |||||||||
| 55 | |||||||||||
| 56 | 0 | ▶ | if ($missing) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 57 | 0 | @dark = grep { not $_->is_satisfied } @dark; | |||||||||
| 58 | } | ||||||||||
| 59 | 0 | @dark = sort { lc $a->uri cmp lc $b->uri } @dark; | |||||||||
| 60 | 0 | return @dark; | |||||||||
| 61 | } | ||||||||||
| 62 | |||||||||||
| 63 | 0 | ▶ | sub execute { | ||||||||
|
Subroutine
execute: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 64 | 0 | my ( $self, $opt, ) = @_; | |||||||||
| 65 | 0 | my $logger = $self->app->chrome->logger; | |||||||||
| 66 | 0 | $logger->mute; | |||||||||
| 67 | 0 | for ( $self->_extract_dependencies( $self->zilla, $opt->missing, ) ) { | |||||||||
| 68 | 0 | ▶ | say $_->uri or do { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 69 | 0 | $logger->unmute; | |||||||||
| 70 | 0 | $logger->log_fatal('Error writing to output'); | |||||||||
| 71 | }; | ||||||||||
| 72 | } | ||||||||||
| 73 | 0 | return 1; | |||||||||
| 74 | } | ||||||||||
| 75 | 1 | 1; | |||||||||
| 76 | |||||||||||
| 77 | __END__ | ||||||||||