File Coverage

blib/lib/App/UpdateCPANfile/Change.pm
Criterion Covered Total %
statement 23 23 100.0
branch n/a
condition n/a
subroutine 10 10 100.0
pod 0 7 0.0
total 33 40 82.5


line stmt bran cond sub pod time code
1             package App::UpdateCPANfile::Change;
2 2     2   252714 use strict;
  2         14  
  2         72  
3 2     2   11 use warnings;
  2         5  
  2         89  
4              
5 2     2   1151 use CPAN::DistnameInfo;
  2         2180  
  2         925  
6              
7             sub new {
8 46     46 0 7441 my ($class, %params) = @_;
9              
10 46         596 bless { %params }, $class;
11             }
12              
13 72     72 0 27627 sub package_name { $_[0]->{package_name} };
14 13     13 0 275 sub path { $_[0]->{path} };
15 66     66 0 6399 sub version { $_[0]->{version} };
16              
17             sub dist_name {
18 2     2 0 191 my ($self) = @_;
19              
20 2         7 CPAN::DistnameInfo->new($self->path)->dist
21             }
22              
23             sub prereqs {
24 12     12 0 585 my ($self) = @_;
25              
26             [
27 12         35 [$self->package_name => "== @{[ $self->version ]}"],
  12         35  
28 12         28 [$self->package_name => "== @{[ $self->version ]}", relationship => 'suggests'],
29 12         28 [$self->package_name => "== @{[ $self->version ]}", relationship => 'recommends'],
30             # Don't touch conflicts
31             ];
32             }
33              
34             sub as_hashref {
35 1     1 0 5 my ($self) = @_;
36              
37             {
38 1         21 package_name => $self->package_name,
39             version => $self->version,
40             path => $self->path,
41             dist_name => $self->dist_name,
42             }
43             }
44              
45             1;