File Coverage

blib/lib/App/cpanm/meta/checker/State/Duplicates/Dist.pm
Criterion Covered Total %
statement 18 29 62.0
branch n/a
condition n/a
subroutine 6 11 54.5
pod 3 3 100.0
total 27 43 62.7


line stmt bran cond sub pod time code
1 4     4   1157 use 5.008; # utf8
  4         13  
  4         163  
2 4     4   23 use strict;
  4         28  
  4         169  
3 4     4   21 use warnings;
  4         8  
  4         104  
4 4     4   903 use utf8;
  4         34  
  4         24  
5              
6             package App::cpanm::meta::checker::State::Duplicates::Dist;
7             $App::cpanm::meta::checker::State::Duplicates::Dist::VERSION = '0.001001';
8             # ABSTRACT: State information for recording seen versions of a single dist
9              
10             our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
11              
12 4     4   1039 use Moo qw( has );
  4         16447  
  4         23  
13              
14              
15              
16              
17              
18             has 'reported' => (
19             is => rw =>,
20             lazy => 1,
21 0     0     builder => sub { return; },
22             );
23              
24              
25              
26              
27              
28             has 'versions' => (
29             is => ro =>,
30             lazy => 1,
31 0     0     builder => sub { return {} },
32             );
33              
34              
35              
36              
37              
38              
39              
40              
41              
42             sub has_duplicates {
43 0     0 1   my ($self) = @_;
44 0           return ( keys %{ $self->versions } > 1 );
  0            
45             }
46              
47              
48              
49              
50              
51              
52              
53              
54              
55             sub seen_version {
56 0     0 1   my ( $self, $version ) = @_;
57 0           $self->versions->{$version} = 1;
58 0           return;
59             }
60              
61              
62              
63              
64              
65              
66              
67              
68              
69             sub duplicate_versions {
70 0     0 1   my ($self) = @_;
71 0           return keys %{ $self->versions };
  0            
72             }
73              
74 4     4   3248 no Moo;
  4         9  
  4         21  
75              
76             1;
77              
78             __END__