line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Table2YAML; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
3250
|
use common::sense; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
13
|
|
4
|
1
|
|
|
1
|
|
5080
|
use charnames q(:full); |
|
1
|
|
|
|
|
132874
|
|
|
1
|
|
|
|
|
11
|
|
5
|
1
|
|
|
1
|
|
277
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
95
|
|
6
|
1
|
|
|
1
|
|
3657
|
use English qw[-no_match_vars]; |
|
1
|
|
|
|
|
7243
|
|
|
1
|
|
|
|
|
10
|
|
7
|
1
|
|
|
1
|
|
7856
|
use Moo; |
|
1
|
|
|
|
|
46211
|
|
|
1
|
|
|
|
|
82
|
|
8
|
1
|
|
|
1
|
|
4023
|
use App::Table2YAML::Loader; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
88
|
|
9
|
1
|
|
|
1
|
|
1284
|
use App::Table2YAML::Serializer; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
822
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.003'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has loader => ( |
14
|
|
|
|
|
|
|
is => q(rw), |
15
|
|
|
|
|
|
|
default => sub { App::Table2YAML::Loader->new(); }, |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
has serializer => ( |
18
|
|
|
|
|
|
|
is => q(rw), |
19
|
|
|
|
|
|
|
default => sub { App::Table2YAML::Serializer->new(); }, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub BUILD { |
23
|
2
|
|
|
2
|
0
|
82
|
my $self = shift; |
24
|
2
|
|
|
|
|
7
|
my $args = shift; |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
4
|
foreach my $method ( keys %{$args} ) { |
|
2
|
|
|
|
|
9
|
|
27
|
4
|
|
|
|
|
9
|
foreach my $class (qw[loader serializer]) { |
28
|
8
|
100
|
|
|
|
147
|
if ( $self->$class->can($method) ) { |
29
|
4
|
|
|
|
|
10
|
my $value = delete $args->{$method}; |
30
|
4
|
|
|
|
|
26
|
$self->$class->$method($value); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
2
|
|
|
|
|
43
|
return 1; |
36
|
|
|
|
|
|
|
} ## end sub BUILD |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub convert { |
39
|
1
|
|
|
1
|
1
|
714
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
1
|
|
|
|
|
9
|
my @table = $self->loader->load(); |
42
|
|
|
|
|
|
|
|
43
|
1
|
50
|
|
|
|
9
|
return unless @table; |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
17
|
my @yaml = $self->serializer->serialize(@table); |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
return @yaml; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
1
|
|
|
1
|
|
11
|
no Moo; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
7
|
|
51
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |