line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dancer::Serializer::Dumper; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:SUKRIA'; |
3
|
|
|
|
|
|
|
# ABSTRACT: Data::Dumper serialisation for Dancer |
4
|
|
|
|
|
|
|
$Dancer::Serializer::Dumper::VERSION = '1.3520'; |
5
|
165
|
|
|
165
|
|
1198
|
use strict; |
|
165
|
|
|
|
|
423
|
|
|
165
|
|
|
|
|
4819
|
|
6
|
165
|
|
|
165
|
|
885
|
use warnings; |
|
165
|
|
|
|
|
429
|
|
|
165
|
|
|
|
|
3831
|
|
7
|
165
|
|
|
165
|
|
845
|
use Carp; |
|
165
|
|
|
|
|
403
|
|
|
165
|
|
|
|
|
8930
|
|
8
|
165
|
|
|
165
|
|
1084
|
use base 'Dancer::Serializer::Abstract'; |
|
165
|
|
|
|
|
467
|
|
|
165
|
|
|
|
|
17358
|
|
9
|
165
|
|
|
165
|
|
1230
|
use Data::Dumper; |
|
165
|
|
|
|
|
432
|
|
|
165
|
|
|
|
|
10013
|
|
10
|
165
|
|
|
165
|
|
1237
|
use Dancer::Exception qw(:all); |
|
165
|
|
|
|
|
489
|
|
|
165
|
|
|
|
|
60681
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub from_dumper { |
13
|
0
|
|
|
0
|
0
|
0
|
my ($string) = @_; |
14
|
0
|
|
|
|
|
0
|
my $s = Dancer::Serializer::Dumper->new; |
15
|
0
|
|
|
|
|
0
|
$s->deserialize($string); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub to_dumper { |
19
|
1
|
|
|
1
|
0
|
5
|
my ($data) = @_; |
20
|
1
|
|
|
|
|
6
|
my $s = Dancer::Serializer::Dumper->new; |
21
|
1
|
|
|
|
|
6
|
$s->serialize($data); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub serialize { |
25
|
2
|
|
|
2
|
0
|
1901
|
my ($self, $entity) = @_; |
26
|
|
|
|
|
|
|
{ |
27
|
2
|
|
|
|
|
5
|
local $Data::Dumper::Purity = 1; |
|
2
|
|
|
|
|
7
|
|
28
|
2
|
|
|
|
|
10
|
return Dumper($entity); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub deserialize { |
33
|
1
|
|
|
1
|
0
|
746
|
my ($self, $content) = @_; |
34
|
1
|
|
|
|
|
73
|
my $res = eval "my \$VAR1; $content"; |
35
|
1
|
50
|
|
|
|
11
|
raise core_serializer => "unable to deserialize : $@" if $@; |
36
|
1
|
|
|
|
|
4
|
return $res; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
1
|
0
|
648
|
sub content_type {'text/x-data-dumper'} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |