line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Spoon::MetadataObject; |
2
|
1
|
|
|
1
|
|
1758
|
use Spoon::DataObject -Base; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
15
|
|
3
|
1
|
|
|
1
|
|
830
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
683
|
|
4
|
|
|
|
|
|
|
const class_id => 'metadata'; |
5
|
|
|
|
|
|
|
|
6
|
0
|
|
|
0
|
0
|
|
sub parse_yaml_file { |
7
|
0
|
|
|
|
|
|
$self->hub->config->parse_yaml_file(shift); |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
|
10
|
0
|
|
|
0
|
0
|
|
sub print_yaml_file { |
11
|
0
|
|
|
|
|
|
my $file = shift; |
12
|
0
|
|
|
|
|
|
my $hash = shift; |
13
|
0
|
|
|
|
|
|
my $yaml = ''; |
14
|
0
|
|
|
|
|
|
for my $key ($self->sort_order) { |
15
|
0
|
|
|
|
|
|
my $value = $hash->{$key}; |
16
|
0
|
0
|
|
|
|
|
$value = '' unless defined $value; |
17
|
0
|
|
|
|
|
|
$yaml .= "$key: $value\n"; |
18
|
|
|
|
|
|
|
} |
19
|
0
|
|
|
|
|
|
$yaml =~ s/\s+(?=\n)//g; |
20
|
0
|
|
|
|
|
|
io($file)->utf8->print($yaml); |
21
|
0
|
|
|
|
|
|
return $self; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
0
|
0
|
|
sub from_hash { |
25
|
0
|
|
|
|
|
|
my $hash = shift; |
26
|
|
|
|
|
|
|
exists $hash->{$_} and $self->$_($hash->{$_}) |
27
|
0
|
|
0
|
|
|
|
for $self->sort_order; |
28
|
0
|
|
|
|
|
|
return $self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
0
|
|
sub to_hash { |
32
|
0
|
|
|
|
|
|
my $hash = {}; |
33
|
|
|
|
|
|
|
$hash->{$_} = $self->$_ |
34
|
0
|
|
|
|
|
|
for $self->sort_order; |
35
|
0
|
|
|
|
|
|
return $hash; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
0
|
0
|
|
sub update { |
39
|
0
|
|
|
|
|
|
return $self; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__DATA__ |