line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Enbld::Target::Attribute::Extension; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
22372
|
use strict; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
270
|
|
4
|
6
|
|
|
6
|
|
32
|
use warnings; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
145
|
|
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
30
|
use Carp; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
396
|
|
7
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
899
|
use parent qw/Enbld::Target::AttributeExtension::Word/; |
|
6
|
|
|
|
|
699
|
|
|
6
|
|
|
|
|
37
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub initialize { |
11
|
58
|
|
|
58
|
0
|
237
|
my ( $self, $param ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
58
|
100
|
|
|
|
220
|
if ( ! defined $param ) { |
14
|
1
|
|
|
|
|
10
|
$self->{value} = 'tar.gz'; |
15
|
1
|
|
|
|
|
3
|
$self->{is_evaluated}++; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
2
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
57
|
100
|
|
|
|
262
|
if ( $param ) { |
21
|
56
|
|
|
|
|
336
|
$self->SUPER::initialize( $param ); |
22
|
56
|
|
|
|
|
152
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
5
|
require Enbld::Exception; |
26
|
1
|
|
|
|
|
8
|
croak( Enbld::Exception->new( "Attribute 'Extension' isn't defined" ) ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
our @extensions = qw/tar.gz tgz tar.bz2/; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub validate { |
32
|
73
|
|
|
73
|
0
|
133
|
my ( $self, $string ) = @_; |
33
|
|
|
|
|
|
|
|
34
|
73
|
|
|
|
|
293
|
$self->SUPER::validate( $string ); |
35
|
|
|
|
|
|
|
|
36
|
70
|
100
|
|
|
|
232
|
return $string if ( grep { $string eq $_ } @extensions ); |
|
210
|
|
|
|
|
697
|
|
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
3
|
my $err = "Attribute 'Extension' is invalid string"; |
39
|
1
|
|
|
|
|
7
|
require Enbld::Exception; |
40
|
1
|
|
|
|
|
5
|
croak( Enbld::Exception->new( $err, $string )); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |