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