| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Hades::Macro::YAML; |
|
2
|
2
|
|
|
2
|
|
140525
|
use strict; |
|
|
2
|
|
|
|
|
14
|
|
|
|
2
|
|
|
|
|
64
|
|
|
3
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
54
|
|
|
4
|
2
|
|
|
2
|
|
26
|
use base qw/Hades::Macro/; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
1163
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = 0.02; |
|
6
|
|
|
|
|
|
|
our ( $YAML_CLASS, $CLASS_LOADED ); |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
BEGIN { |
|
9
|
|
|
|
|
|
|
$YAML_CLASS = eval { |
|
10
|
|
|
|
|
|
|
require YAML::XS; |
|
11
|
|
|
|
|
|
|
'YAML::XS'; |
|
12
|
|
|
|
|
|
|
} || eval { |
|
13
|
|
|
|
|
|
|
require YAML::PP; |
|
14
|
|
|
|
|
|
|
'YAML::PP'; |
|
15
|
2
|
|
33
|
2
|
|
1703
|
} || eval { |
|
16
|
|
|
|
|
|
|
require YAML; |
|
17
|
|
|
|
|
|
|
'YAML'; |
|
18
|
|
|
|
|
|
|
}; |
|
19
|
2
|
50
|
|
|
|
10338
|
die |
|
20
|
|
|
|
|
|
|
'No supported YAML module installed - supported modules are YAML::XS, YAML::PP or YAML' |
|
21
|
|
|
|
|
|
|
unless $YAML_CLASS; |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub new { |
|
25
|
24
|
100
|
|
24
|
1
|
51619
|
my ( $cls, %args ) = ( shift(), scalar @_ == 1 ? %{ $_[0] } : @_ ); |
|
|
22
|
|
|
|
|
71
|
|
|
26
|
24
|
|
|
|
|
87
|
my $self = $cls->SUPER::new(%args); |
|
27
|
22
|
|
|
|
|
323
|
my %accessors = ( |
|
28
|
|
|
|
|
|
|
macro => { |
|
29
|
|
|
|
|
|
|
default => [ |
|
30
|
|
|
|
|
|
|
qw/ |
|
31
|
|
|
|
|
|
|
yaml_load_string |
|
32
|
|
|
|
|
|
|
yaml_load_file |
|
33
|
|
|
|
|
|
|
yaml_write_string |
|
34
|
|
|
|
|
|
|
yaml_write_file |
|
35
|
|
|
|
|
|
|
/ |
|
36
|
|
|
|
|
|
|
], |
|
37
|
|
|
|
|
|
|
}, |
|
38
|
|
|
|
|
|
|
); |
|
39
|
22
|
|
|
|
|
50
|
for my $accessor ( keys %accessors ) { |
|
40
|
|
|
|
|
|
|
my $param |
|
41
|
|
|
|
|
|
|
= defined $args{$accessor} |
|
42
|
|
|
|
|
|
|
? $args{$accessor} |
|
43
|
22
|
100
|
|
|
|
51
|
: $accessors{$accessor}->{default}; |
|
44
|
|
|
|
|
|
|
my $value |
|
45
|
|
|
|
|
|
|
= $self->$accessor( $accessors{$accessor}->{builder} |
|
46
|
22
|
50
|
|
|
|
76
|
? $accessors{$accessor}->{builder}->( $self, $param ) |
|
47
|
|
|
|
|
|
|
: $param ); |
|
48
|
22
|
50
|
33
|
|
|
71
|
unless ( !$accessors{$accessor}->{required} || defined $value ) { |
|
49
|
0
|
|
|
|
|
0
|
die "$accessor accessor is required"; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
} |
|
52
|
22
|
|
|
|
|
134
|
return $self; |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub macro { |
|
56
|
51
|
|
|
51
|
1
|
1891
|
my ( $self, $value ) = @_; |
|
57
|
51
|
100
|
|
|
|
115
|
if ( defined $value ) { |
|
58
|
49
|
100
|
100
|
|
|
139
|
if ( ( ref($value) || "" ) ne "ARRAY" ) { |
|
59
|
4
|
|
|
|
|
40
|
die qq{ArrayRef: invalid value $value for accessor macro}; |
|
60
|
|
|
|
|
|
|
} |
|
61
|
45
|
|
|
|
|
94
|
$self->{macro} = $value; |
|
62
|
|
|
|
|
|
|
} |
|
63
|
47
|
|
|
|
|
103
|
return $self->{macro}; |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub yaml_load_string { |
|
67
|
8
|
|
|
8
|
1
|
4391
|
my ( $self, $mg, $str, $param, $list ) = @_; |
|
68
|
8
|
100
|
100
|
|
|
58
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
69
|
2
|
50
|
|
|
|
6
|
$mg = defined $mg ? $mg : 'undef'; |
|
70
|
2
|
|
|
|
|
18
|
die |
|
71
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method yaml_load_string}; |
|
72
|
|
|
|
|
|
|
} |
|
73
|
6
|
100
|
66
|
|
|
28
|
if ( !defined($str) || ref $str ) { |
|
74
|
2
|
50
|
|
|
|
7
|
$str = defined $str ? $str : 'undef'; |
|
75
|
2
|
|
|
|
|
17
|
die |
|
76
|
|
|
|
|
|
|
qq{Str: invalid value $str for variable \$str in method yaml_load_string}; |
|
77
|
|
|
|
|
|
|
} |
|
78
|
4
|
100
|
|
|
|
11
|
if ( defined $param ) { |
|
79
|
2
|
50
|
|
|
|
8
|
if ( ref $param ) { |
|
80
|
2
|
|
|
|
|
19
|
die |
|
81
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method yaml_load_string}; |
|
82
|
|
|
|
|
|
|
} |
|
83
|
|
|
|
|
|
|
} |
|
84
|
2
|
50
|
|
|
|
5
|
if ( defined $list ) { |
|
85
|
2
|
|
|
|
|
5
|
my $ref = ref $list; |
|
86
|
2
|
0
|
50
|
|
|
9
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
88
|
|
|
|
|
|
|
{ |
|
89
|
2
|
|
|
|
|
19
|
die |
|
90
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method yaml_load_string}; |
|
91
|
|
|
|
|
|
|
} |
|
92
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
} |
|
94
|
|
|
|
|
|
|
|
|
95
|
0
|
0
|
|
|
|
0
|
unless ($CLASS_LOADED) { |
|
96
|
0
|
|
|
|
|
0
|
$mg->use($YAML_CLASS); |
|
97
|
|
|
|
|
|
|
} |
|
98
|
0
|
|
|
|
|
0
|
( my $uf = $YAML_CLASS ) =~ s/\:\:/_/g; |
|
99
|
0
|
|
|
|
|
0
|
my $cb = "_yaml_load_string_$uf"; |
|
100
|
0
|
|
|
|
|
0
|
return __PACKAGE__->$cb( $mg, $str, $param, $list ); |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
} |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub _yaml_load_string_YAML { |
|
105
|
8
|
|
|
8
|
|
4386
|
my ( $self, $mg, $str, $param, $list ) = @_; |
|
106
|
8
|
100
|
100
|
|
|
58
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
107
|
2
|
50
|
|
|
|
7
|
$mg = defined $mg ? $mg : 'undef'; |
|
108
|
2
|
|
|
|
|
19
|
die |
|
109
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method _yaml_load_string_YAML}; |
|
110
|
|
|
|
|
|
|
} |
|
111
|
6
|
100
|
66
|
|
|
31
|
if ( !defined($str) || ref $str ) { |
|
112
|
2
|
50
|
|
|
|
6
|
$str = defined $str ? $str : 'undef'; |
|
113
|
2
|
|
|
|
|
18
|
die |
|
114
|
|
|
|
|
|
|
qq{Str: invalid value $str for variable \$str in method _yaml_load_string_YAML}; |
|
115
|
|
|
|
|
|
|
} |
|
116
|
4
|
100
|
|
|
|
13
|
if ( defined $param ) { |
|
117
|
2
|
50
|
|
|
|
6
|
if ( ref $param ) { |
|
118
|
2
|
|
|
|
|
19
|
die |
|
119
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method _yaml_load_string_YAML}; |
|
120
|
|
|
|
|
|
|
} |
|
121
|
|
|
|
|
|
|
} |
|
122
|
2
|
50
|
|
|
|
6
|
if ( defined $list ) { |
|
123
|
2
|
|
|
|
|
3
|
my $ref = ref $list; |
|
124
|
2
|
0
|
50
|
|
|
10
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
125
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
126
|
|
|
|
|
|
|
{ |
|
127
|
2
|
|
|
|
|
21
|
die |
|
128
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method _yaml_load_string_YAML}; |
|
129
|
|
|
|
|
|
|
} |
|
130
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
} |
|
132
|
|
|
|
|
|
|
|
|
133
|
0
|
|
|
|
|
0
|
my $code = q||; |
|
134
|
0
|
0
|
|
|
|
0
|
$code .= qq|$param = | if $param; |
|
135
|
0
|
|
|
|
|
0
|
$code .= qq|YAML::Load($str)|; |
|
136
|
0
|
0
|
|
|
|
0
|
$code .= $list ? q|,| : q|;|; |
|
137
|
0
|
|
|
|
|
0
|
return $code; |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
} |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
sub _yaml_load_string_YAML_XS { |
|
142
|
8
|
|
|
8
|
|
4332
|
my ( $self, $mg, $str, $param, $list ) = @_; |
|
143
|
8
|
100
|
100
|
|
|
59
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
144
|
2
|
50
|
|
|
|
8
|
$mg = defined $mg ? $mg : 'undef'; |
|
145
|
2
|
|
|
|
|
19
|
die |
|
146
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method _yaml_load_string_YAML_XS}; |
|
147
|
|
|
|
|
|
|
} |
|
148
|
6
|
100
|
66
|
|
|
29
|
if ( !defined($str) || ref $str ) { |
|
149
|
2
|
50
|
|
|
|
7
|
$str = defined $str ? $str : 'undef'; |
|
150
|
2
|
|
|
|
|
19
|
die |
|
151
|
|
|
|
|
|
|
qq{Str: invalid value $str for variable \$str in method _yaml_load_string_YAML_XS}; |
|
152
|
|
|
|
|
|
|
} |
|
153
|
4
|
100
|
|
|
|
11
|
if ( defined $param ) { |
|
154
|
2
|
50
|
|
|
|
7
|
if ( ref $param ) { |
|
155
|
2
|
|
|
|
|
20
|
die |
|
156
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method _yaml_load_string_YAML_XS}; |
|
157
|
|
|
|
|
|
|
} |
|
158
|
|
|
|
|
|
|
} |
|
159
|
2
|
50
|
|
|
|
6
|
if ( defined $list ) { |
|
160
|
2
|
|
|
|
|
4
|
my $ref = ref $list; |
|
161
|
2
|
0
|
50
|
|
|
10
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
162
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
163
|
|
|
|
|
|
|
{ |
|
164
|
2
|
|
|
|
|
21
|
die |
|
165
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method _yaml_load_string_YAML_XS}; |
|
166
|
|
|
|
|
|
|
} |
|
167
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
} |
|
169
|
|
|
|
|
|
|
|
|
170
|
0
|
|
|
|
|
0
|
my $code = q||; |
|
171
|
0
|
0
|
|
|
|
0
|
$code .= qq|$param = | if $param; |
|
172
|
0
|
|
|
|
|
0
|
$code .= qq|Load($str)|; |
|
173
|
0
|
0
|
|
|
|
0
|
$code .= $list ? q|,| : q|;|; |
|
174
|
0
|
|
|
|
|
0
|
return $code; |
|
175
|
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
} |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
sub _yaml_load_string_YAML_PP { |
|
179
|
8
|
|
|
8
|
|
4369
|
my ( $self, $mg, $str, $param, $list ) = @_; |
|
180
|
8
|
100
|
100
|
|
|
60
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
181
|
2
|
50
|
|
|
|
6
|
$mg = defined $mg ? $mg : 'undef'; |
|
182
|
2
|
|
|
|
|
19
|
die |
|
183
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method _yaml_load_string_YAML_PP}; |
|
184
|
|
|
|
|
|
|
} |
|
185
|
6
|
100
|
66
|
|
|
30
|
if ( !defined($str) || ref $str ) { |
|
186
|
2
|
50
|
|
|
|
8
|
$str = defined $str ? $str : 'undef'; |
|
187
|
2
|
|
|
|
|
19
|
die |
|
188
|
|
|
|
|
|
|
qq{Str: invalid value $str for variable \$str in method _yaml_load_string_YAML_PP}; |
|
189
|
|
|
|
|
|
|
} |
|
190
|
4
|
100
|
|
|
|
12
|
if ( defined $param ) { |
|
191
|
2
|
50
|
|
|
|
6
|
if ( ref $param ) { |
|
192
|
2
|
|
|
|
|
20
|
die |
|
193
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method _yaml_load_string_YAML_PP}; |
|
194
|
|
|
|
|
|
|
} |
|
195
|
|
|
|
|
|
|
} |
|
196
|
2
|
50
|
|
|
|
6
|
if ( defined $list ) { |
|
197
|
2
|
|
|
|
|
5
|
my $ref = ref $list; |
|
198
|
2
|
0
|
50
|
|
|
9
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
199
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
200
|
|
|
|
|
|
|
{ |
|
201
|
2
|
|
|
|
|
20
|
die |
|
202
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method _yaml_load_string_YAML_PP}; |
|
203
|
|
|
|
|
|
|
} |
|
204
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
} |
|
206
|
|
|
|
|
|
|
|
|
207
|
0
|
|
|
|
|
0
|
my $code = q|my $lpp = YAML::PP->new;|; |
|
208
|
0
|
0
|
|
|
|
0
|
$code .= qq|$param = | if $param; |
|
209
|
0
|
|
|
|
|
0
|
$code .= qq|\$lpp->load_string($str);|; |
|
210
|
0
|
0
|
|
|
|
0
|
$code = $list ? qq|do { $code },| : qq|$code;|; |
|
211
|
0
|
|
|
|
|
0
|
return $code; |
|
212
|
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
} |
|
214
|
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
sub yaml_load_file { |
|
216
|
8
|
|
|
8
|
1
|
4391
|
my ( $self, $mg, $file, $param, $list ) = @_; |
|
217
|
8
|
100
|
100
|
|
|
60
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
218
|
2
|
50
|
|
|
|
8
|
$mg = defined $mg ? $mg : 'undef'; |
|
219
|
2
|
|
|
|
|
17
|
die |
|
220
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method yaml_load_file}; |
|
221
|
|
|
|
|
|
|
} |
|
222
|
6
|
100
|
66
|
|
|
31
|
if ( !defined($file) || ref $file ) { |
|
223
|
2
|
50
|
|
|
|
7
|
$file = defined $file ? $file : 'undef'; |
|
224
|
2
|
|
|
|
|
20
|
die |
|
225
|
|
|
|
|
|
|
qq{Str: invalid value $file for variable \$file in method yaml_load_file}; |
|
226
|
|
|
|
|
|
|
} |
|
227
|
4
|
100
|
|
|
|
11
|
if ( defined $param ) { |
|
228
|
2
|
50
|
|
|
|
6
|
if ( ref $param ) { |
|
229
|
2
|
|
|
|
|
21
|
die |
|
230
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method yaml_load_file}; |
|
231
|
|
|
|
|
|
|
} |
|
232
|
|
|
|
|
|
|
} |
|
233
|
2
|
50
|
|
|
|
11
|
if ( defined $list ) { |
|
234
|
2
|
|
|
|
|
5
|
my $ref = ref $list; |
|
235
|
2
|
0
|
50
|
|
|
10
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
236
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
237
|
|
|
|
|
|
|
{ |
|
238
|
2
|
|
|
|
|
20
|
die |
|
239
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method yaml_load_file}; |
|
240
|
|
|
|
|
|
|
} |
|
241
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
} |
|
243
|
|
|
|
|
|
|
|
|
244
|
0
|
0
|
|
|
|
0
|
unless ($CLASS_LOADED) { |
|
245
|
0
|
|
|
|
|
0
|
$mg->use($YAML_CLASS); |
|
246
|
|
|
|
|
|
|
} |
|
247
|
0
|
|
|
|
|
0
|
( my $uf = $YAML_CLASS ) =~ s/\:\:/_/g; |
|
248
|
0
|
|
|
|
|
0
|
my $cb = "_yaml_load_file_$uf"; |
|
249
|
0
|
|
|
|
|
0
|
return __PACKAGE__->$cb( $mg, $file, $param, $list ); |
|
250
|
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
} |
|
252
|
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
sub _yaml_load_file_YAML { |
|
254
|
8
|
|
|
8
|
|
4351
|
my ( $self, $mg, $file, $param, $list ) = @_; |
|
255
|
8
|
100
|
100
|
|
|
58
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
256
|
2
|
50
|
|
|
|
7
|
$mg = defined $mg ? $mg : 'undef'; |
|
257
|
2
|
|
|
|
|
19
|
die |
|
258
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method _yaml_load_file_YAML}; |
|
259
|
|
|
|
|
|
|
} |
|
260
|
6
|
100
|
66
|
|
|
28
|
if ( !defined($file) || ref $file ) { |
|
261
|
2
|
50
|
|
|
|
7
|
$file = defined $file ? $file : 'undef'; |
|
262
|
2
|
|
|
|
|
21
|
die |
|
263
|
|
|
|
|
|
|
qq{Str: invalid value $file for variable \$file in method _yaml_load_file_YAML}; |
|
264
|
|
|
|
|
|
|
} |
|
265
|
4
|
100
|
|
|
|
12
|
if ( defined $param ) { |
|
266
|
2
|
50
|
|
|
|
7
|
if ( ref $param ) { |
|
267
|
2
|
|
|
|
|
18
|
die |
|
268
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method _yaml_load_file_YAML}; |
|
269
|
|
|
|
|
|
|
} |
|
270
|
|
|
|
|
|
|
} |
|
271
|
2
|
50
|
|
|
|
5
|
if ( defined $list ) { |
|
272
|
2
|
|
|
|
|
5
|
my $ref = ref $list; |
|
273
|
2
|
0
|
50
|
|
|
10
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
274
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
275
|
|
|
|
|
|
|
{ |
|
276
|
2
|
|
|
|
|
20
|
die |
|
277
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method _yaml_load_file_YAML}; |
|
278
|
|
|
|
|
|
|
} |
|
279
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
} |
|
281
|
|
|
|
|
|
|
|
|
282
|
0
|
|
|
|
|
0
|
my $code = q||; |
|
283
|
0
|
0
|
|
|
|
0
|
$code .= qq|$param = | if $param; |
|
284
|
0
|
|
|
|
|
0
|
$code .= qq|YAML::LoadFile($file)|; |
|
285
|
0
|
0
|
|
|
|
0
|
$code .= $list ? q|,| : q|;|; |
|
286
|
0
|
|
|
|
|
0
|
return $code; |
|
287
|
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
} |
|
289
|
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
sub _yaml_load_file_YAML_XS { |
|
291
|
8
|
|
|
8
|
|
4415
|
my ( $self, $mg, $file, $param, $list ) = @_; |
|
292
|
8
|
100
|
100
|
|
|
58
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
293
|
2
|
50
|
|
|
|
8
|
$mg = defined $mg ? $mg : 'undef'; |
|
294
|
2
|
|
|
|
|
19
|
die |
|
295
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method _yaml_load_file_YAML_XS}; |
|
296
|
|
|
|
|
|
|
} |
|
297
|
6
|
100
|
66
|
|
|
32
|
if ( !defined($file) || ref $file ) { |
|
298
|
2
|
50
|
|
|
|
6
|
$file = defined $file ? $file : 'undef'; |
|
299
|
2
|
|
|
|
|
21
|
die |
|
300
|
|
|
|
|
|
|
qq{Str: invalid value $file for variable \$file in method _yaml_load_file_YAML_XS}; |
|
301
|
|
|
|
|
|
|
} |
|
302
|
4
|
100
|
|
|
|
11
|
if ( defined $param ) { |
|
303
|
2
|
50
|
|
|
|
6
|
if ( ref $param ) { |
|
304
|
2
|
|
|
|
|
20
|
die |
|
305
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method _yaml_load_file_YAML_XS}; |
|
306
|
|
|
|
|
|
|
} |
|
307
|
|
|
|
|
|
|
} |
|
308
|
2
|
50
|
|
|
|
7
|
if ( defined $list ) { |
|
309
|
2
|
|
|
|
|
5
|
my $ref = ref $list; |
|
310
|
2
|
0
|
50
|
|
|
10
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
311
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
312
|
|
|
|
|
|
|
{ |
|
313
|
2
|
|
|
|
|
19
|
die |
|
314
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method _yaml_load_file_YAML_XS}; |
|
315
|
|
|
|
|
|
|
} |
|
316
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
} |
|
318
|
|
|
|
|
|
|
|
|
319
|
0
|
|
|
|
|
0
|
my $code = q||; |
|
320
|
0
|
0
|
|
|
|
0
|
$code .= qq|$param = | if $param; |
|
321
|
0
|
|
|
|
|
0
|
$code .= qq|LoadFile($file)|; |
|
322
|
0
|
0
|
|
|
|
0
|
$code .= $list ? q|,| : q|;|; |
|
323
|
0
|
|
|
|
|
0
|
return $code; |
|
324
|
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
} |
|
326
|
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
sub _yaml_load_file_YAML_PP { |
|
328
|
8
|
|
|
8
|
|
4375
|
my ( $self, $mg, $file, $param, $list ) = @_; |
|
329
|
8
|
100
|
100
|
|
|
66
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
330
|
2
|
50
|
|
|
|
8
|
$mg = defined $mg ? $mg : 'undef'; |
|
331
|
2
|
|
|
|
|
19
|
die |
|
332
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method _yaml_load_file_YAML_PP}; |
|
333
|
|
|
|
|
|
|
} |
|
334
|
6
|
100
|
66
|
|
|
31
|
if ( !defined($file) || ref $file ) { |
|
335
|
2
|
50
|
|
|
|
8
|
$file = defined $file ? $file : 'undef'; |
|
336
|
2
|
|
|
|
|
19
|
die |
|
337
|
|
|
|
|
|
|
qq{Str: invalid value $file for variable \$file in method _yaml_load_file_YAML_PP}; |
|
338
|
|
|
|
|
|
|
} |
|
339
|
4
|
100
|
|
|
|
10
|
if ( defined $param ) { |
|
340
|
2
|
50
|
|
|
|
8
|
if ( ref $param ) { |
|
341
|
2
|
|
|
|
|
20
|
die |
|
342
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method _yaml_load_file_YAML_PP}; |
|
343
|
|
|
|
|
|
|
} |
|
344
|
|
|
|
|
|
|
} |
|
345
|
2
|
50
|
|
|
|
6
|
if ( defined $list ) { |
|
346
|
2
|
|
|
|
|
6
|
my $ref = ref $list; |
|
347
|
2
|
0
|
50
|
|
|
9
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
348
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
349
|
|
|
|
|
|
|
{ |
|
350
|
2
|
|
|
|
|
18
|
die |
|
351
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method _yaml_load_file_YAML_PP}; |
|
352
|
|
|
|
|
|
|
} |
|
353
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
} |
|
355
|
|
|
|
|
|
|
|
|
356
|
0
|
|
|
|
|
0
|
my $code = q|my $lpp = YAML::PP->new;|; |
|
357
|
0
|
0
|
|
|
|
0
|
$code .= qq|$param = | if $param; |
|
358
|
0
|
|
|
|
|
0
|
$code .= qq|\$lpp->load_file($file);|; |
|
359
|
0
|
0
|
|
|
|
0
|
$code = $list ? qq|do { $code },| : qq|$code;|; |
|
360
|
0
|
|
|
|
|
0
|
return $code; |
|
361
|
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
} |
|
363
|
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
sub yaml_write_string { |
|
365
|
8
|
|
|
8
|
1
|
4394
|
my ( $self, $mg, $content, $param, $list ) = @_; |
|
366
|
8
|
100
|
100
|
|
|
57
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
367
|
2
|
50
|
|
|
|
6
|
$mg = defined $mg ? $mg : 'undef'; |
|
368
|
2
|
|
|
|
|
20
|
die |
|
369
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method yaml_write_string}; |
|
370
|
|
|
|
|
|
|
} |
|
371
|
6
|
100
|
66
|
|
|
31
|
if ( !defined($content) || ref $content ) { |
|
372
|
2
|
50
|
|
|
|
5
|
$content = defined $content ? $content : 'undef'; |
|
373
|
2
|
|
|
|
|
22
|
die |
|
374
|
|
|
|
|
|
|
qq{Str: invalid value $content for variable \$content in method yaml_write_string}; |
|
375
|
|
|
|
|
|
|
} |
|
376
|
4
|
100
|
|
|
|
11
|
if ( defined $param ) { |
|
377
|
2
|
50
|
|
|
|
6
|
if ( ref $param ) { |
|
378
|
2
|
|
|
|
|
20
|
die |
|
379
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method yaml_write_string}; |
|
380
|
|
|
|
|
|
|
} |
|
381
|
|
|
|
|
|
|
} |
|
382
|
2
|
50
|
|
|
|
6
|
if ( defined $list ) { |
|
383
|
2
|
|
|
|
|
5
|
my $ref = ref $list; |
|
384
|
2
|
0
|
50
|
|
|
10
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
385
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
386
|
|
|
|
|
|
|
{ |
|
387
|
2
|
|
|
|
|
19
|
die |
|
388
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method yaml_write_string}; |
|
389
|
|
|
|
|
|
|
} |
|
390
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
} |
|
392
|
|
|
|
|
|
|
|
|
393
|
0
|
0
|
|
|
|
0
|
unless ($CLASS_LOADED) { |
|
394
|
0
|
|
|
|
|
0
|
$mg->use($YAML_CLASS); |
|
395
|
|
|
|
|
|
|
} |
|
396
|
0
|
|
|
|
|
0
|
( my $uf = $YAML_CLASS ) =~ s/\:\:/_/g; |
|
397
|
0
|
|
|
|
|
0
|
my $cb = "_yaml_write_string_$uf"; |
|
398
|
0
|
|
|
|
|
0
|
return __PACKAGE__->$cb( $mg, $content, $param, $list ); |
|
399
|
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
} |
|
401
|
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
sub _yaml_write_string_YAML { |
|
403
|
8
|
|
|
8
|
|
4332
|
my ( $self, $mg, $content, $param, $list ) = @_; |
|
404
|
8
|
100
|
100
|
|
|
57
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
405
|
2
|
50
|
|
|
|
8
|
$mg = defined $mg ? $mg : 'undef'; |
|
406
|
2
|
|
|
|
|
18
|
die |
|
407
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method _yaml_write_string_YAML}; |
|
408
|
|
|
|
|
|
|
} |
|
409
|
6
|
100
|
66
|
|
|
30
|
if ( !defined($content) || ref $content ) { |
|
410
|
2
|
50
|
|
|
|
6
|
$content = defined $content ? $content : 'undef'; |
|
411
|
2
|
|
|
|
|
20
|
die |
|
412
|
|
|
|
|
|
|
qq{Str: invalid value $content for variable \$content in method _yaml_write_string_YAML}; |
|
413
|
|
|
|
|
|
|
} |
|
414
|
4
|
100
|
|
|
|
11
|
if ( defined $param ) { |
|
415
|
2
|
50
|
|
|
|
7
|
if ( ref $param ) { |
|
416
|
2
|
|
|
|
|
19
|
die |
|
417
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method _yaml_write_string_YAML}; |
|
418
|
|
|
|
|
|
|
} |
|
419
|
|
|
|
|
|
|
} |
|
420
|
2
|
50
|
|
|
|
7
|
if ( defined $list ) { |
|
421
|
2
|
|
|
|
|
6
|
my $ref = ref $list; |
|
422
|
2
|
0
|
50
|
|
|
11
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
423
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
424
|
|
|
|
|
|
|
{ |
|
425
|
2
|
|
|
|
|
19
|
die |
|
426
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method _yaml_write_string_YAML}; |
|
427
|
|
|
|
|
|
|
} |
|
428
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
} |
|
430
|
|
|
|
|
|
|
|
|
431
|
0
|
|
|
|
|
0
|
my $code = q||; |
|
432
|
0
|
0
|
|
|
|
0
|
$code .= qq|$param = | if $param; |
|
433
|
0
|
|
|
|
|
0
|
$code .= qq|YAML::Dump($content)|; |
|
434
|
0
|
0
|
|
|
|
0
|
$code .= $list ? q|,| : q|;|; |
|
435
|
0
|
|
|
|
|
0
|
return $code; |
|
436
|
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
} |
|
438
|
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
sub _yaml_write_string_YAML_XS { |
|
440
|
8
|
|
|
8
|
|
4366
|
my ( $self, $mg, $content, $param, $list ) = @_; |
|
441
|
8
|
100
|
100
|
|
|
56
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
442
|
2
|
50
|
|
|
|
8
|
$mg = defined $mg ? $mg : 'undef'; |
|
443
|
2
|
|
|
|
|
20
|
die |
|
444
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method _yaml_write_string_YAML_XS}; |
|
445
|
|
|
|
|
|
|
} |
|
446
|
6
|
100
|
66
|
|
|
30
|
if ( !defined($content) || ref $content ) { |
|
447
|
2
|
50
|
|
|
|
6
|
$content = defined $content ? $content : 'undef'; |
|
448
|
2
|
|
|
|
|
19
|
die |
|
449
|
|
|
|
|
|
|
qq{Str: invalid value $content for variable \$content in method _yaml_write_string_YAML_XS}; |
|
450
|
|
|
|
|
|
|
} |
|
451
|
4
|
100
|
|
|
|
11
|
if ( defined $param ) { |
|
452
|
2
|
50
|
|
|
|
6
|
if ( ref $param ) { |
|
453
|
2
|
|
|
|
|
21
|
die |
|
454
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method _yaml_write_string_YAML_XS}; |
|
455
|
|
|
|
|
|
|
} |
|
456
|
|
|
|
|
|
|
} |
|
457
|
2
|
50
|
|
|
|
7
|
if ( defined $list ) { |
|
458
|
2
|
|
|
|
|
5
|
my $ref = ref $list; |
|
459
|
2
|
0
|
50
|
|
|
10
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
460
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
461
|
|
|
|
|
|
|
{ |
|
462
|
2
|
|
|
|
|
19
|
die |
|
463
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method _yaml_write_string_YAML_XS}; |
|
464
|
|
|
|
|
|
|
} |
|
465
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
} |
|
467
|
|
|
|
|
|
|
|
|
468
|
0
|
|
|
|
|
0
|
my $code = q||; |
|
469
|
0
|
0
|
|
|
|
0
|
$code .= qq|$param = | if $param; |
|
470
|
0
|
|
|
|
|
0
|
$code .= qq|Dump($content)|; |
|
471
|
0
|
0
|
|
|
|
0
|
$code .= $list ? q|,| : q|;|; |
|
472
|
0
|
|
|
|
|
0
|
return $code; |
|
473
|
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
} |
|
475
|
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
sub _yaml_write_string_YAML_PP { |
|
477
|
8
|
|
|
8
|
|
4416
|
my ( $self, $mg, $content, $param, $list ) = @_; |
|
478
|
8
|
100
|
100
|
|
|
70
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
479
|
2
|
50
|
|
|
|
8
|
$mg = defined $mg ? $mg : 'undef'; |
|
480
|
2
|
|
|
|
|
19
|
die |
|
481
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method _yaml_write_string_YAML_PP}; |
|
482
|
|
|
|
|
|
|
} |
|
483
|
6
|
100
|
66
|
|
|
29
|
if ( !defined($content) || ref $content ) { |
|
484
|
2
|
50
|
|
|
|
7
|
$content = defined $content ? $content : 'undef'; |
|
485
|
2
|
|
|
|
|
31
|
die |
|
486
|
|
|
|
|
|
|
qq{Str: invalid value $content for variable \$content in method _yaml_write_string_YAML_PP}; |
|
487
|
|
|
|
|
|
|
} |
|
488
|
4
|
100
|
|
|
|
10
|
if ( defined $param ) { |
|
489
|
2
|
50
|
|
|
|
6
|
if ( ref $param ) { |
|
490
|
2
|
|
|
|
|
19
|
die |
|
491
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method _yaml_write_string_YAML_PP}; |
|
492
|
|
|
|
|
|
|
} |
|
493
|
|
|
|
|
|
|
} |
|
494
|
2
|
50
|
|
|
|
6
|
if ( defined $list ) { |
|
495
|
2
|
|
|
|
|
6
|
my $ref = ref $list; |
|
496
|
2
|
0
|
50
|
|
|
9
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
497
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
498
|
|
|
|
|
|
|
{ |
|
499
|
2
|
|
|
|
|
20
|
die |
|
500
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method _yaml_write_string_YAML_PP}; |
|
501
|
|
|
|
|
|
|
} |
|
502
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
} |
|
504
|
|
|
|
|
|
|
|
|
505
|
0
|
|
|
|
|
0
|
my $code = q|my $wpp = YAML::PP->new;|; |
|
506
|
0
|
0
|
|
|
|
0
|
$code .= qq|$param = | if $param; |
|
507
|
0
|
|
|
|
|
0
|
$code .= qq|\$wpp->dump_string($content)|; |
|
508
|
0
|
0
|
|
|
|
0
|
$code = $list ? qq|do { $code },| : qq|$code;|; |
|
509
|
0
|
|
|
|
|
0
|
return $code; |
|
510
|
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
} |
|
512
|
|
|
|
|
|
|
|
|
513
|
|
|
|
|
|
|
sub yaml_write_file { |
|
514
|
10
|
|
|
10
|
1
|
5654
|
my ( $self, $mg, $file, $content, $param, $list ) = @_; |
|
515
|
10
|
100
|
100
|
|
|
70
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
516
|
2
|
50
|
|
|
|
6
|
$mg = defined $mg ? $mg : 'undef'; |
|
517
|
2
|
|
|
|
|
20
|
die |
|
518
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method yaml_write_file}; |
|
519
|
|
|
|
|
|
|
} |
|
520
|
8
|
100
|
66
|
|
|
37
|
if ( !defined($file) || ref $file ) { |
|
521
|
2
|
50
|
|
|
|
6
|
$file = defined $file ? $file : 'undef'; |
|
522
|
2
|
|
|
|
|
19
|
die |
|
523
|
|
|
|
|
|
|
qq{Str: invalid value $file for variable \$file in method yaml_write_file}; |
|
524
|
|
|
|
|
|
|
} |
|
525
|
6
|
100
|
66
|
|
|
23
|
if ( !defined($content) || ref $content ) { |
|
526
|
2
|
50
|
|
|
|
6
|
$content = defined $content ? $content : 'undef'; |
|
527
|
2
|
|
|
|
|
19
|
die |
|
528
|
|
|
|
|
|
|
qq{Str: invalid value $content for variable \$content in method yaml_write_file}; |
|
529
|
|
|
|
|
|
|
} |
|
530
|
4
|
100
|
|
|
|
10
|
if ( defined $param ) { |
|
531
|
2
|
50
|
|
|
|
7
|
if ( ref $param ) { |
|
532
|
2
|
|
|
|
|
20
|
die |
|
533
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method yaml_write_file}; |
|
534
|
|
|
|
|
|
|
} |
|
535
|
|
|
|
|
|
|
} |
|
536
|
2
|
50
|
|
|
|
7
|
if ( defined $list ) { |
|
537
|
2
|
|
|
|
|
7
|
my $ref = ref $list; |
|
538
|
2
|
0
|
50
|
|
|
10
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
539
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
540
|
|
|
|
|
|
|
{ |
|
541
|
2
|
|
|
|
|
20
|
die |
|
542
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method yaml_write_file}; |
|
543
|
|
|
|
|
|
|
} |
|
544
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
545
|
|
|
|
|
|
|
} |
|
546
|
|
|
|
|
|
|
|
|
547
|
0
|
0
|
|
|
|
0
|
unless ($CLASS_LOADED) { |
|
548
|
0
|
|
|
|
|
0
|
$mg->use($YAML_CLASS); |
|
549
|
|
|
|
|
|
|
} |
|
550
|
0
|
|
|
|
|
0
|
( my $uf = $YAML_CLASS ) =~ s/\:\:/_/g; |
|
551
|
0
|
|
|
|
|
0
|
my $cb = "_yaml_write_file_$uf"; |
|
552
|
0
|
|
|
|
|
0
|
return __PACKAGE__->$cb( $mg, $file, $content, $param, $list ); |
|
553
|
|
|
|
|
|
|
|
|
554
|
|
|
|
|
|
|
} |
|
555
|
|
|
|
|
|
|
|
|
556
|
|
|
|
|
|
|
sub _yaml_write_file_YAML { |
|
557
|
10
|
|
|
10
|
|
5596
|
my ( $self, $mg, $file, $content, $param, $list ) = @_; |
|
558
|
10
|
100
|
100
|
|
|
69
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
559
|
2
|
50
|
|
|
|
7
|
$mg = defined $mg ? $mg : 'undef'; |
|
560
|
2
|
|
|
|
|
19
|
die |
|
561
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method _yaml_write_file_YAML}; |
|
562
|
|
|
|
|
|
|
} |
|
563
|
8
|
100
|
66
|
|
|
37
|
if ( !defined($file) || ref $file ) { |
|
564
|
2
|
50
|
|
|
|
7
|
$file = defined $file ? $file : 'undef'; |
|
565
|
2
|
|
|
|
|
19
|
die |
|
566
|
|
|
|
|
|
|
qq{Str: invalid value $file for variable \$file in method _yaml_write_file_YAML}; |
|
567
|
|
|
|
|
|
|
} |
|
568
|
6
|
100
|
66
|
|
|
24
|
if ( !defined($content) || ref $content ) { |
|
569
|
2
|
50
|
|
|
|
6
|
$content = defined $content ? $content : 'undef'; |
|
570
|
2
|
|
|
|
|
20
|
die |
|
571
|
|
|
|
|
|
|
qq{Str: invalid value $content for variable \$content in method _yaml_write_file_YAML}; |
|
572
|
|
|
|
|
|
|
} |
|
573
|
4
|
100
|
|
|
|
11
|
if ( defined $param ) { |
|
574
|
2
|
50
|
|
|
|
7
|
if ( ref $param ) { |
|
575
|
2
|
|
|
|
|
20
|
die |
|
576
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method _yaml_write_file_YAML}; |
|
577
|
|
|
|
|
|
|
} |
|
578
|
|
|
|
|
|
|
} |
|
579
|
2
|
50
|
|
|
|
6
|
if ( defined $list ) { |
|
580
|
2
|
|
|
|
|
5
|
my $ref = ref $list; |
|
581
|
2
|
0
|
50
|
|
|
10
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
582
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
583
|
|
|
|
|
|
|
{ |
|
584
|
2
|
|
|
|
|
19
|
die |
|
585
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method _yaml_write_file_YAML}; |
|
586
|
|
|
|
|
|
|
} |
|
587
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
588
|
|
|
|
|
|
|
} |
|
589
|
|
|
|
|
|
|
|
|
590
|
0
|
|
|
|
|
0
|
my $code = q||; |
|
591
|
0
|
0
|
|
|
|
0
|
$code .= qq|$param = | if $param; |
|
592
|
0
|
|
|
|
|
0
|
$code .= qq|YAML::DumpFile($file, $content)|; |
|
593
|
0
|
0
|
|
|
|
0
|
$code .= $list ? q|,| : q|;|; |
|
594
|
0
|
|
|
|
|
0
|
return $code; |
|
595
|
|
|
|
|
|
|
|
|
596
|
|
|
|
|
|
|
} |
|
597
|
|
|
|
|
|
|
|
|
598
|
|
|
|
|
|
|
sub _yaml_write_file_YAML_XS { |
|
599
|
10
|
|
|
10
|
|
5847
|
my ( $self, $mg, $file, $content, $param, $list ) = @_; |
|
600
|
10
|
100
|
100
|
|
|
71
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
601
|
2
|
50
|
|
|
|
7
|
$mg = defined $mg ? $mg : 'undef'; |
|
602
|
2
|
|
|
|
|
19
|
die |
|
603
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method _yaml_write_file_YAML_XS}; |
|
604
|
|
|
|
|
|
|
} |
|
605
|
8
|
100
|
66
|
|
|
37
|
if ( !defined($file) || ref $file ) { |
|
606
|
2
|
50
|
|
|
|
7
|
$file = defined $file ? $file : 'undef'; |
|
607
|
2
|
|
|
|
|
20
|
die |
|
608
|
|
|
|
|
|
|
qq{Str: invalid value $file for variable \$file in method _yaml_write_file_YAML_XS}; |
|
609
|
|
|
|
|
|
|
} |
|
610
|
6
|
100
|
66
|
|
|
23
|
if ( !defined($content) || ref $content ) { |
|
611
|
2
|
50
|
|
|
|
7
|
$content = defined $content ? $content : 'undef'; |
|
612
|
2
|
|
|
|
|
19
|
die |
|
613
|
|
|
|
|
|
|
qq{Str: invalid value $content for variable \$content in method _yaml_write_file_YAML_XS}; |
|
614
|
|
|
|
|
|
|
} |
|
615
|
4
|
100
|
|
|
|
11
|
if ( defined $param ) { |
|
616
|
2
|
50
|
|
|
|
6
|
if ( ref $param ) { |
|
617
|
2
|
|
|
|
|
20
|
die |
|
618
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method _yaml_write_file_YAML_XS}; |
|
619
|
|
|
|
|
|
|
} |
|
620
|
|
|
|
|
|
|
} |
|
621
|
2
|
50
|
|
|
|
7
|
if ( defined $list ) { |
|
622
|
2
|
|
|
|
|
5
|
my $ref = ref $list; |
|
623
|
2
|
0
|
50
|
|
|
9
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
624
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
625
|
|
|
|
|
|
|
{ |
|
626
|
2
|
|
|
|
|
22
|
die |
|
627
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method _yaml_write_file_YAML_XS}; |
|
628
|
|
|
|
|
|
|
} |
|
629
|
0
|
0
|
|
|
|
0
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
630
|
|
|
|
|
|
|
} |
|
631
|
|
|
|
|
|
|
|
|
632
|
0
|
|
|
|
|
0
|
my $code = q||; |
|
633
|
0
|
0
|
|
|
|
0
|
$code .= qq|$param = | if $param; |
|
634
|
0
|
|
|
|
|
0
|
$code .= qq|DumpFile($file, $content)|; |
|
635
|
0
|
0
|
|
|
|
0
|
$code .= $list ? q|,| : q|;|; |
|
636
|
0
|
|
|
|
|
0
|
return $code; |
|
637
|
|
|
|
|
|
|
|
|
638
|
|
|
|
|
|
|
} |
|
639
|
|
|
|
|
|
|
|
|
640
|
|
|
|
|
|
|
sub _yaml_write_file_YAML_PP { |
|
641
|
10
|
|
|
10
|
|
5580
|
my ( $self, $mg, $file, $content, $param, $list ) = @_; |
|
642
|
10
|
100
|
100
|
|
|
74
|
if ( ( ref($mg) || "" ) =~ m/^(|HASH|ARRAY|SCALAR|CODE|GLOB)$/ ) { |
|
643
|
2
|
50
|
|
|
|
6
|
$mg = defined $mg ? $mg : 'undef'; |
|
644
|
2
|
|
|
|
|
19
|
die |
|
645
|
|
|
|
|
|
|
qq{Object: invalid value $mg for variable \$mg in method _yaml_write_file_YAML_PP}; |
|
646
|
|
|
|
|
|
|
} |
|
647
|
8
|
100
|
66
|
|
|
39
|
if ( !defined($file) || ref $file ) { |
|
648
|
2
|
50
|
|
|
|
6
|
$file = defined $file ? $file : 'undef'; |
|
649
|
2
|
|
|
|
|
20
|
die |
|
650
|
|
|
|
|
|
|
qq{Str: invalid value $file for variable \$file in method _yaml_write_file_YAML_PP}; |
|
651
|
|
|
|
|
|
|
} |
|
652
|
6
|
100
|
66
|
|
|
22
|
if ( !defined($content) || ref $content ) { |
|
653
|
2
|
50
|
|
|
|
6
|
$content = defined $content ? $content : 'undef'; |
|
654
|
2
|
|
|
|
|
19
|
die |
|
655
|
|
|
|
|
|
|
qq{Str: invalid value $content for variable \$content in method _yaml_write_file_YAML_PP}; |
|
656
|
|
|
|
|
|
|
} |
|
657
|
4
|
100
|
|
|
|
11
|
if ( defined $param ) { |
|
658
|
2
|
50
|
|
|
|
7
|
if ( ref $param ) { |
|
659
|
2
|
|
|
|
|
20
|
die |
|
660
|
|
|
|
|
|
|
qq{Optional[Str]: invalid value $param for variable \$param in method _yaml_write_file_YAML_PP}; |
|
661
|
|
|
|
|
|
|
} |
|
662
|
|
|
|
|
|
|
} |
|
663
|
2
|
50
|
|
|
|
7
|
if ( defined $list ) { |
|
664
|
2
|
|
|
|
|
5
|
my $ref = ref $list; |
|
665
|
2
|
0
|
50
|
|
|
10
|
if ( ( $ref || 'SCALAR' ) ne 'SCALAR' |
|
|
|
50
|
33
|
|
|
|
|
|
666
|
|
|
|
|
|
|
|| ( $ref ? $$list : $list ) !~ m/^(1|0)$/ ) |
|
667
|
|
|
|
|
|
|
{ |
|
668
|
2
|
|
|
|
|
20
|
die |
|
669
|
|
|
|
|
|
|
qq{Optional[Bool]: invalid value $list for variable \$list in method _yaml_write_file_YAML_PP}; |
|
670
|
|
|
|
|
|
|
} |
|
671
|
0
|
0
|
|
|
|
|
$list = !!( $ref ? $$list : $list ) ? 1 : 0; |
|
|
|
0
|
|
|
|
|
|
|
672
|
|
|
|
|
|
|
} |
|
673
|
|
|
|
|
|
|
|
|
674
|
0
|
|
|
|
|
|
my $code = q|my \$wpp = YAML::PP->new;|; |
|
675
|
0
|
0
|
|
|
|
|
$code .= qq|$param = | if $param; |
|
676
|
0
|
|
|
|
|
|
$code .= qq|\$wpp->load_file($file, $content);|; |
|
677
|
0
|
0
|
|
|
|
|
$code = $list ? qq|do { $code },| : qq|$code;|; |
|
678
|
0
|
|
|
|
|
|
return $code; |
|
679
|
|
|
|
|
|
|
|
|
680
|
|
|
|
|
|
|
} |
|
681
|
|
|
|
|
|
|
|
|
682
|
|
|
|
|
|
|
1; |
|
683
|
|
|
|
|
|
|
|
|
684
|
|
|
|
|
|
|
__END__ |
|
685
|
|
|
|
|
|
|
|
|
686
|
|
|
|
|
|
|
=head1 NAME |
|
687
|
|
|
|
|
|
|
|
|
688
|
|
|
|
|
|
|
Hades::Macro::YAML - Hades macro helpers for YAML |
|
689
|
|
|
|
|
|
|
|
|
690
|
|
|
|
|
|
|
=head1 VERSION |
|
691
|
|
|
|
|
|
|
|
|
692
|
|
|
|
|
|
|
Version 0.01 |
|
693
|
|
|
|
|
|
|
|
|
694
|
|
|
|
|
|
|
=cut |
|
695
|
|
|
|
|
|
|
|
|
696
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
697
|
|
|
|
|
|
|
|
|
698
|
|
|
|
|
|
|
Quick summary of what the module does: |
|
699
|
|
|
|
|
|
|
|
|
700
|
|
|
|
|
|
|
Hades->run({ |
|
701
|
|
|
|
|
|
|
eval => q| |
|
702
|
|
|
|
|
|
|
macro { |
|
703
|
|
|
|
|
|
|
YAML |
|
704
|
|
|
|
|
|
|
} |
|
705
|
|
|
|
|
|
|
Kosmos { |
|
706
|
|
|
|
|
|
|
geras $file :t(Str) :d('path/to/file.yml') { |
|
707
|
|
|
|
|
|
|
€yaml_load_file($file); |
|
708
|
|
|
|
|
|
|
} |
|
709
|
|
|
|
|
|
|
} |
|
710
|
|
|
|
|
|
|
|; |
|
711
|
|
|
|
|
|
|
}); |
|
712
|
|
|
|
|
|
|
|
|
713
|
|
|
|
|
|
|
... generates ... |
|
714
|
|
|
|
|
|
|
|
|
715
|
|
|
|
|
|
|
package Kosmos; |
|
716
|
|
|
|
|
|
|
use strict; |
|
717
|
|
|
|
|
|
|
use warnings; |
|
718
|
|
|
|
|
|
|
use YAML::XS; |
|
719
|
|
|
|
|
|
|
our $VERSION = 0.01; |
|
720
|
|
|
|
|
|
|
|
|
721
|
|
|
|
|
|
|
sub new { |
|
722
|
|
|
|
|
|
|
my ( $cls, %args ) = ( shift(), scalar @_ == 1 ? %{ $_[0] } : @_ ); |
|
723
|
|
|
|
|
|
|
my $self = bless {}, $cls; |
|
724
|
|
|
|
|
|
|
my %accessors = (); |
|
725
|
|
|
|
|
|
|
for my $accessor ( keys %accessors ) { |
|
726
|
|
|
|
|
|
|
my $param |
|
727
|
|
|
|
|
|
|
= defined $args{$accessor} |
|
728
|
|
|
|
|
|
|
? $args{$accessor} |
|
729
|
|
|
|
|
|
|
: $accessors{$accessor}->{default}; |
|
730
|
|
|
|
|
|
|
my $value |
|
731
|
|
|
|
|
|
|
= $self->$accessor( $accessors{$accessor}->{builder} |
|
732
|
|
|
|
|
|
|
? $accessors{$accessor}->{builder}->( $self, $param ) |
|
733
|
|
|
|
|
|
|
: $param ); |
|
734
|
|
|
|
|
|
|
unless ( !$accessors{$accessor}->{required} || defined $value ) { |
|
735
|
|
|
|
|
|
|
die "$accessor accessor is required"; |
|
736
|
|
|
|
|
|
|
} |
|
737
|
|
|
|
|
|
|
} |
|
738
|
|
|
|
|
|
|
return $self; |
|
739
|
|
|
|
|
|
|
} |
|
740
|
|
|
|
|
|
|
|
|
741
|
|
|
|
|
|
|
sub geras { |
|
742
|
|
|
|
|
|
|
my ( $self, $file ) = @_; |
|
743
|
|
|
|
|
|
|
$file = defined $file ? $file : 'path/to/file.yml'; |
|
744
|
|
|
|
|
|
|
if ( !defined($file) || ref $file ) { |
|
745
|
|
|
|
|
|
|
$file = defined $file ? $file : 'undef'; |
|
746
|
|
|
|
|
|
|
die qq{Str: invalid value $file for variable \$file in method geras}; |
|
747
|
|
|
|
|
|
|
} |
|
748
|
|
|
|
|
|
|
|
|
749
|
|
|
|
|
|
|
LoadFile($file); |
|
750
|
|
|
|
|
|
|
} |
|
751
|
|
|
|
|
|
|
|
|
752
|
|
|
|
|
|
|
1; |
|
753
|
|
|
|
|
|
|
|
|
754
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
|
755
|
|
|
|
|
|
|
|
|
756
|
|
|
|
|
|
|
=head2 new |
|
757
|
|
|
|
|
|
|
|
|
758
|
|
|
|
|
|
|
Instantiate a new Hades::Macro::YAML object. |
|
759
|
|
|
|
|
|
|
|
|
760
|
|
|
|
|
|
|
Hades::Macro::YAML->new |
|
761
|
|
|
|
|
|
|
|
|
762
|
|
|
|
|
|
|
=head2 yaml_load_string |
|
763
|
|
|
|
|
|
|
|
|
764
|
|
|
|
|
|
|
call yaml_load_string method. Expects param $mg to be a Object, param $str to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
765
|
|
|
|
|
|
|
|
|
766
|
|
|
|
|
|
|
$obj->yaml_load_string($mg, $str, $param, $list) |
|
767
|
|
|
|
|
|
|
|
|
768
|
|
|
|
|
|
|
=head2 _yaml_load_string_YAML |
|
769
|
|
|
|
|
|
|
|
|
770
|
|
|
|
|
|
|
call _yaml_load_string_YAML method. Expects param $mg to be a Object, param $str to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
771
|
|
|
|
|
|
|
|
|
772
|
|
|
|
|
|
|
$obj->_yaml_load_string_YAML($mg, $str, $param, $list) |
|
773
|
|
|
|
|
|
|
|
|
774
|
|
|
|
|
|
|
=head2 _yaml_load_string_YAML_XS |
|
775
|
|
|
|
|
|
|
|
|
776
|
|
|
|
|
|
|
call _yaml_load_string_YAML_XS method. Expects param $mg to be a Object, param $str to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
777
|
|
|
|
|
|
|
|
|
778
|
|
|
|
|
|
|
$obj->_yaml_load_string_YAML_XS($mg, $str, $param, $list) |
|
779
|
|
|
|
|
|
|
|
|
780
|
|
|
|
|
|
|
=head2 _yaml_load_string_YAML_PP |
|
781
|
|
|
|
|
|
|
|
|
782
|
|
|
|
|
|
|
call _yaml_load_string_YAML_PP method. Expects param $mg to be a Object, param $str to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
783
|
|
|
|
|
|
|
|
|
784
|
|
|
|
|
|
|
$obj->_yaml_load_string_YAML_PP($mg, $str, $param, $list) |
|
785
|
|
|
|
|
|
|
|
|
786
|
|
|
|
|
|
|
=head2 yaml_load_file |
|
787
|
|
|
|
|
|
|
|
|
788
|
|
|
|
|
|
|
call yaml_load_file method. Expects param $mg to be a Object, param $file to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
789
|
|
|
|
|
|
|
|
|
790
|
|
|
|
|
|
|
$obj->yaml_load_file($mg, $file, $param, $list) |
|
791
|
|
|
|
|
|
|
|
|
792
|
|
|
|
|
|
|
=head2 _yaml_load_file_YAML |
|
793
|
|
|
|
|
|
|
|
|
794
|
|
|
|
|
|
|
call _yaml_load_file_YAML method. Expects param $mg to be a Object, param $file to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
795
|
|
|
|
|
|
|
|
|
796
|
|
|
|
|
|
|
$obj->_yaml_load_file_YAML($mg, $file, $param, $list) |
|
797
|
|
|
|
|
|
|
|
|
798
|
|
|
|
|
|
|
=head2 _yaml_load_file_YAML_XS |
|
799
|
|
|
|
|
|
|
|
|
800
|
|
|
|
|
|
|
call _yaml_load_file_YAML_XS method. Expects param $mg to be a Object, param $file to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
801
|
|
|
|
|
|
|
|
|
802
|
|
|
|
|
|
|
$obj->_yaml_load_file_YAML_XS($mg, $file, $param, $list) |
|
803
|
|
|
|
|
|
|
|
|
804
|
|
|
|
|
|
|
=head2 _yaml_load_file_YAML_PP |
|
805
|
|
|
|
|
|
|
|
|
806
|
|
|
|
|
|
|
call _yaml_load_file_YAML_PP method. Expects param $mg to be a Object, param $file to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
807
|
|
|
|
|
|
|
|
|
808
|
|
|
|
|
|
|
$obj->_yaml_load_file_YAML_PP($mg, $file, $param, $list) |
|
809
|
|
|
|
|
|
|
|
|
810
|
|
|
|
|
|
|
=head2 yaml_write_string |
|
811
|
|
|
|
|
|
|
|
|
812
|
|
|
|
|
|
|
call yaml_write_string method. Expects param $mg to be a Object, param $content to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
813
|
|
|
|
|
|
|
|
|
814
|
|
|
|
|
|
|
$obj->yaml_write_string($mg, $content, $param, $list) |
|
815
|
|
|
|
|
|
|
|
|
816
|
|
|
|
|
|
|
=head2 _yaml_write_string_YAML |
|
817
|
|
|
|
|
|
|
|
|
818
|
|
|
|
|
|
|
call _yaml_write_string_YAML method. Expects param $mg to be a Object, param $content to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
819
|
|
|
|
|
|
|
|
|
820
|
|
|
|
|
|
|
$obj->_yaml_write_string_YAML($mg, $content, $param, $list) |
|
821
|
|
|
|
|
|
|
|
|
822
|
|
|
|
|
|
|
=head2 _yaml_write_string_YAML_XS |
|
823
|
|
|
|
|
|
|
|
|
824
|
|
|
|
|
|
|
call _yaml_write_string_YAML_XS method. Expects param $mg to be a Object, param $content to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
825
|
|
|
|
|
|
|
|
|
826
|
|
|
|
|
|
|
$obj->_yaml_write_string_YAML_XS($mg, $content, $param, $list) |
|
827
|
|
|
|
|
|
|
|
|
828
|
|
|
|
|
|
|
=head2 _yaml_write_string_YAML_PP |
|
829
|
|
|
|
|
|
|
|
|
830
|
|
|
|
|
|
|
call _yaml_write_string_YAML_PP method. Expects param $mg to be a Object, param $content to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
831
|
|
|
|
|
|
|
|
|
832
|
|
|
|
|
|
|
$obj->_yaml_write_string_YAML_PP($mg, $content, $param, $list) |
|
833
|
|
|
|
|
|
|
|
|
834
|
|
|
|
|
|
|
=head2 yaml_write_file |
|
835
|
|
|
|
|
|
|
|
|
836
|
|
|
|
|
|
|
call yaml_write_file method. Expects param $mg to be a Object, param $file to be a Str, param $content to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
837
|
|
|
|
|
|
|
|
|
838
|
|
|
|
|
|
|
$obj->yaml_write_file($mg, $file, $content, $param, $list) |
|
839
|
|
|
|
|
|
|
|
|
840
|
|
|
|
|
|
|
=head2 _yaml_write_file_YAML |
|
841
|
|
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
call _yaml_write_file_YAML method. Expects param $mg to be a Object, param $file to be a Str, param $content to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
843
|
|
|
|
|
|
|
|
|
844
|
|
|
|
|
|
|
$obj->_yaml_write_file_YAML($mg, $file, $content, $param, $list) |
|
845
|
|
|
|
|
|
|
|
|
846
|
|
|
|
|
|
|
=head2 _yaml_write_file_YAML_XS |
|
847
|
|
|
|
|
|
|
|
|
848
|
|
|
|
|
|
|
call _yaml_write_file_YAML_XS method. Expects param $mg to be a Object, param $file to be a Str, param $content to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
849
|
|
|
|
|
|
|
|
|
850
|
|
|
|
|
|
|
$obj->_yaml_write_file_YAML_XS($mg, $file, $content, $param, $list) |
|
851
|
|
|
|
|
|
|
|
|
852
|
|
|
|
|
|
|
=head2 _yaml_write_file_YAML_PP |
|
853
|
|
|
|
|
|
|
|
|
854
|
|
|
|
|
|
|
call _yaml_write_file_YAML_PP method. Expects param $mg to be a Object, param $file to be a Str, param $content to be a Str, param $param to be a Optional[Str], param $list to be a Optional[Bool]. |
|
855
|
|
|
|
|
|
|
|
|
856
|
|
|
|
|
|
|
$obj->_yaml_write_file_YAML_PP($mg, $file, $content, $param, $list) |
|
857
|
|
|
|
|
|
|
|
|
858
|
|
|
|
|
|
|
=head1 ACCESSORS |
|
859
|
|
|
|
|
|
|
|
|
860
|
|
|
|
|
|
|
=head2 macro |
|
861
|
|
|
|
|
|
|
|
|
862
|
|
|
|
|
|
|
get or set macro. |
|
863
|
|
|
|
|
|
|
|
|
864
|
|
|
|
|
|
|
$obj->macro; |
|
865
|
|
|
|
|
|
|
|
|
866
|
|
|
|
|
|
|
$obj->macro($value); |
|
867
|
|
|
|
|
|
|
|
|
868
|
|
|
|
|
|
|
=head1 AUTHOR |
|
869
|
|
|
|
|
|
|
|
|
870
|
|
|
|
|
|
|
LNATION, C<< <email at lnation.org> >> |
|
871
|
|
|
|
|
|
|
|
|
872
|
|
|
|
|
|
|
=head1 BUGS |
|
873
|
|
|
|
|
|
|
|
|
874
|
|
|
|
|
|
|
Please report any bugs or feature requests to C<bug-hades::macro::yaml at rt.cpan.org>, or through |
|
875
|
|
|
|
|
|
|
the web interface at L<https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Hades-Macro-YAML>. I will be notified, and then you'll |
|
876
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
|
877
|
|
|
|
|
|
|
|
|
878
|
|
|
|
|
|
|
=head1 SUPPORT |
|
879
|
|
|
|
|
|
|
|
|
880
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
881
|
|
|
|
|
|
|
|
|
882
|
|
|
|
|
|
|
perldoc Hades::Macro::YAML |
|
883
|
|
|
|
|
|
|
|
|
884
|
|
|
|
|
|
|
You can also look for information at: |
|
885
|
|
|
|
|
|
|
|
|
886
|
|
|
|
|
|
|
=over 4 |
|
887
|
|
|
|
|
|
|
|
|
888
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker (report bugs here) |
|
889
|
|
|
|
|
|
|
|
|
890
|
|
|
|
|
|
|
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Hades-Macro-YAML> |
|
891
|
|
|
|
|
|
|
|
|
892
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
|
893
|
|
|
|
|
|
|
|
|
894
|
|
|
|
|
|
|
L<http://annocpan.org/dist/Hades-Macro-YAML> |
|
895
|
|
|
|
|
|
|
|
|
896
|
|
|
|
|
|
|
=item * CPAN Ratings |
|
897
|
|
|
|
|
|
|
|
|
898
|
|
|
|
|
|
|
L<https://cpanratings.perl.org/d/Hades-Macro-YAML> |
|
899
|
|
|
|
|
|
|
|
|
900
|
|
|
|
|
|
|
=item * Search CPAN |
|
901
|
|
|
|
|
|
|
|
|
902
|
|
|
|
|
|
|
L<https://metacpan.org/release/Hades-Macro-YAML> |
|
903
|
|
|
|
|
|
|
|
|
904
|
|
|
|
|
|
|
=back |
|
905
|
|
|
|
|
|
|
|
|
906
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
|
907
|
|
|
|
|
|
|
|
|
908
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
|
909
|
|
|
|
|
|
|
|
|
910
|
|
|
|
|
|
|
This software is Copyright (c) 2020 by LNATION. |
|
911
|
|
|
|
|
|
|
|
|
912
|
|
|
|
|
|
|
This is free software, licensed under: |
|
913
|
|
|
|
|
|
|
|
|
914
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
|
915
|
|
|
|
|
|
|
|
|
916
|
|
|
|
|
|
|
=cut |
|
917
|
|
|
|
|
|
|
|
|
918
|
|
|
|
|
|
|
|