P5U/Command/Testers.pm untested

filter: Statementstmt 0.0% 0 / 39 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 80 CC 4 SCAR 19.7
CC
4
Cov
0%
execute
20.0
BEGIN
2.0
command_names
2.0
CRAP 7.1
1 package P5U::Command::Testers;
2  
3 use 5.010;
4 use strict;
5 use utf8;
6 use P5U-command;
7  
8 use PerlX::Maybe 0 'maybe';
9  
10 BEGIN {
11 $P5U::Command::Testers::AUTHORITY = 'cpan:TOBYINK';
12 $P5U::Command::Testers::VERSION = '0.100';
13 };
14  
15 use constant {
16 abstract => q[show CPAN testers statistics for a distribution],
17 usage_desc => q[%c testers %o Distribution],
18 };
19  
20 sub command_names
21 {
22 qw(
23 testers
24 cpan-testers
25 ct
26 );
27 }
28  
29 sub opt_spec
30 {
31 return (
32 ["version|v=s", "a specific version to query"],
33 ["summary|s", "show summary for all versions"],
34 ["os|o", "break down statistics by operating system"],
35 ["stable|z", "ignore development versions"],
36 )
37 }
38  
39 sub execute
40 {
41 require P5U::Lib::Testers;
42
43 my ($self, $opt, $args) = @_;
44  
45 $self->usage_error("You must provide a distribution name.")
46 if $opt->{summary} && ($opt->{os_data} or length $opt->{version});
47
48 $self->usage_error("You must provide a distribution name.")
49 if $opt->{stable} && length $opt->{version};
50
51 my $distro = shift @$args
52 or $self->usage_error("You must provide a distribution name.");
53 $distro =~ s{::}{-}g;
54
55 # no Test::Tabs
56 my $helper = P5U::Lib::Testers::->new(
57 distro => $distro,
58 os_data => !!$opt->{os_data},
59 stable => !!$opt->{stable},
60 maybe version => $opt->{version},
61 cache_dir => $self->get_cachedir,
62 );
63 # use Test::Tabs
64
65 if ($opt->{summary})
66 { print $helper->summary_report }
67 else
68 { print $helper->version_report }
69 }
70  
71 1;