| 1 | # | ||||||||||||||||||||
| 2 | # (c) Jan Gehring <jan.gehring@gmail.com> | ||||||||||||||||||||
| 3 | # | ||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | package Rex::File::Parser::Data; | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 49 | ▶ | use v5.14.4; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 49 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 49 | our $VERSION = '1.16.1'; # VERSION | |||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 4 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||||||||||||
| 13 | 4 | my $that = shift; | |||||||||||||||||||
| 14 | 4 | ▶ | my $proto = ref($that) || $that; | ||||||||||||||||||
|
Condition33%1/3
ref $that || $that
MC/DC0%0/2
ref $that || $that
ref $that
$that
Truth table33%1/3
A || B
A= ref $thatB= $that
| |||||||||||||||||||||
| 15 | 4 | my $self = {@_}; | |||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 4 | bless( $self, $proto ); | |||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 4 | return $self; | |||||||||||||||||||
| 20 | } | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 4 | ▶ | sub read { | ||||||||||||||||||
|
Subroutine
read: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 23 | 4 | my ( $self, $file ) = @_; | |||||||||||||||||||
| 24 | 4 | return $self->_read_file($file); | |||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 4 | ▶ | sub _read_file { | ||||||||||||||||||
|
Subroutine
_read_file: called CC=5 SCAR=16.1
| |||||||||||||||||||||
| 28 | 4 | my ( $self, $file ) = @_; | |||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 4 | my $content = ""; | |||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 4 | my $in_file = 0; | |||||||||||||||||||
| 33 | 4 | for my $line ( @{ $self->{"data"} } ) { | |||||||||||||||||||
| 34 | 426 | chomp $line; | |||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 426 | ▶ | if ( $line eq "\@end" ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 37 | 10 | $in_file = 0; | |||||||||||||||||||
| 38 | 10 | next; | |||||||||||||||||||
| 39 | } | ||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | 416 | ▶ | if ($in_file) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 42 | 170 | $content .= $line . $/; | |||||||||||||||||||
| 43 | } | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 416 | ▶ | if ( $line eq "\@$file" ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 46 | 4 | $in_file = 1; | |||||||||||||||||||
| 47 | 4 | next; | |||||||||||||||||||
| 48 | } | ||||||||||||||||||||
| 49 | } | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | 4 | return $content; | |||||||||||||||||||
| 52 | } | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 0 | ▶ | sub get { | ||||||||||||||||||
|
Subroutine
get: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 55 | 0 | my ( $self, $file ) = @_; | |||||||||||||||||||
| 56 | } | ||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | 49 | 1; | |||||||||||||||||||