File Coverage

blib/lib/Git/Wrapper/File/RawModification.pm
Criterion Covered Total %
statement 17 21 80.9
branch 2 2 100.0
condition 2 3 66.6
subroutine 7 11 63.6
pod 8 8 100.0
total 36 45 80.0


line stmt bran cond sub pod time code
1             package Git::Wrapper::File::RawModification;
2             # ABSTRACT: Modification of a file in a commit
3             $Git::Wrapper::File::RawModification::VERSION = '0.047_090'; # TRIAL
4              
5 5     5   2023 $Git::Wrapper::File::RawModification::VERSION = '0.047090';use 5.006;
  5         20  
6 5     5   35 use strict;
  5         11  
  5         122  
7 5     5   29 use warnings;
  5         18  
  5         1982  
8              
9             sub new {
10 4     4 1 2171 my ($class, $filename, $type, $perms_from, $perms_to, $blob_from, $blob_to) = @_;
11              
12 4         19 my $score;
13 4 100 66     78 if ( defined $type && $type =~ s{^(.)([0-9]+)$}{$1} ) {
14 2         27 $score = $2;
15 2         49 (undef, $filename) = split(qr{\s+}, $filename, 2 );
16             }
17              
18 4         130 return bless {
19             filename => $filename,
20             type => $type,
21             score => $score,
22             perms_from => $perms_from,
23             perms_to => $perms_to,
24             blob_from => $blob_from,
25             blob_to => $blob_to,
26             } => $class;
27             }
28              
29 2     2 1 17 sub filename { shift->{filename} }
30 2     2 1 17 sub type { shift->{type} }
31 2     2 1 47 sub score { shift->{score} }
32              
33 0     0 1   sub perms_from { shift->{perms_from} }
34 0     0 1   sub perms_to { shift->{perms_to} }
35              
36 0     0 1   sub blob_from { shift->{blob_from} }
37 0     0 1   sub blob_to { shift->{blob_to} }
38              
39             1;
40              
41             __END__