line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Locale::TextDomain::OO::Lexicon::StoreJSON; ## no critic (TidyCode)
|
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
5122
|
use strict;
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
66
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
54
|
|
5
|
2
|
|
|
2
|
|
1384
|
use JSON::PP ();
|
|
2
|
|
|
|
|
26184
|
|
|
2
|
|
|
|
|
68
|
|
6
|
2
|
|
|
2
|
|
18
|
use Moo;
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
17
|
|
7
|
2
|
|
|
2
|
|
743
|
use MooX::StrictConstructor;
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
17
|
|
8
|
2
|
|
|
2
|
|
1834
|
use namespace::autoclean;
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
17
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '1.026';
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with qw(
|
13
|
|
|
|
|
|
|
Locale::TextDomain::OO::Lexicon::Role::StoreFile
|
14
|
|
|
|
|
|
|
Locale::TextDomain::OO::Lexicon::Role::StoreFilter
|
15
|
|
|
|
|
|
|
);
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub to_json {
|
18
|
26
|
|
|
26
|
1
|
52
|
my $self = shift;
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
return $self->store_content(
|
21
|
|
|
|
|
|
|
JSON::PP ## no critic (LongChainsOfMethodCalls)
|
22
|
|
|
|
|
|
|
->new
|
23
|
|
|
|
|
|
|
->utf8
|
24
|
393
|
|
|
393
|
|
17003
|
->sort_by( sub { $JSON::PP::a cmp $JSON::PP::b } ) ## no critic (PackageVars)
|
25
|
26
|
|
|
|
|
111
|
->encode( $self->data ),
|
26
|
|
|
|
|
|
|
);
|
27
|
|
|
|
|
|
|
}
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub to_javascript {
|
30
|
2
|
|
|
2
|
1
|
6
|
my $self = shift;
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
return
|
33
|
2
|
|
|
|
|
6
|
'var localeTextDomainOOLexicon = '
|
34
|
|
|
|
|
|
|
. $self->to_json
|
35
|
|
|
|
|
|
|
. ";\n";
|
36
|
|
|
|
|
|
|
}
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub to_html {
|
39
|
1
|
|
|
1
|
1
|
3
|
my $self = shift;
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
return
|
42
|
1
|
|
|
|
|
4
|
qq{\n};
|
45
|
|
|
|
|
|
|
}
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable;
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1;
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__
|