line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::EDumper; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
54506
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
1
|
|
|
|
|
154102
|
|
|
1
|
|
|
|
|
6
|
|
4
|
|
|
|
|
|
|
#~ use Encode qw(decode); |
5
|
|
|
|
|
|
|
#~ use Data::Recursive::Encode; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.00005'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=pod |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=encoding utf8 |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 ¡ ¡ ¡ ALL GLORY TO GLORIA ! ! ! |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Доброго всем, соответственно |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 VERSION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
0.00005 |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 NAME |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Mojolicious::Plugin::EDumper - pretty dumps encoded data. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 SINOPSYS |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
$app->plugin('EDumper'); |
29
|
|
|
|
|
|
|
$app->plugin('EDumper', helper=>'dumper'); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
$c->dumper( +{'Вася' => 'Пупкин'} ); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 OPTIONS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 helper |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Name of the helper. Default - 'edumper'. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SEE ALSO |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
L |
43
|
|
|
|
|
|
|
L |
44
|
|
|
|
|
|
|
L |
45
|
|
|
|
|
|
|
L |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Redefine might not work: |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub Data::Dumper::qquote { |
50
|
|
|
|
|
|
|
my $s = shift; |
51
|
|
|
|
|
|
|
return "'$s'"; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 AUTHOR |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Михаил Че (Mikhail Che), C<< >> |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 BUGS / CONTRIBUTING |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Please report any bugs or feature requests at L. Pull requests also welcome. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 COPYRIGHT |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Copyright 2016+ Mikhail Che. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
68
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub register { |
73
|
0
|
|
|
0
|
1
|
|
my ($self, $app, $conf) = @_; |
74
|
0
|
|
0
|
|
|
|
my $enc = delete $conf->{enc} || 'utf8'; |
75
|
0
|
|
0
|
|
|
|
my $helper = delete $conf->{helper} || 'edumper'; |
76
|
|
|
|
|
|
|
$app->helper($helper => sub { |
77
|
0
|
|
|
0
|
|
|
shift; |
78
|
|
|
|
|
|
|
#~ decode $enc, |
79
|
|
|
|
|
|
|
#~ Data::Dumper->new(Data::Recursive::Encode->encode($enc, \@_),) |
80
|
|
|
|
|
|
|
#~ ->Indent(1)->Sortkeys(1)->Terse(1)->Useqq(0)->Dump; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
#~ eval 'qq#'. |
83
|
0
|
|
|
|
|
|
Data::Dumper->new(\@_) |
84
|
|
|
|
|
|
|
->Indent(1)->Sortkeys(1)->Terse(1)->Useqq(0)->Dump |
85
|
|
|
|
|
|
|
#~ .'#'; |
86
|
0
|
|
|
|
|
|
=~ s/((?:\\x\{[\da-f]+\})+)/eval '"'.$1.'"'/eigr; |
87
|
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
}); |
89
|
0
|
|
|
|
|
|
return $self; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
1; |