line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
23410
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package CouchDB::View::Document; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
881
|
use URI::Escape; |
|
1
|
|
|
|
|
1463
|
|
|
1
|
|
|
|
|
67
|
|
7
|
1
|
|
|
1
|
|
1527
|
use Data::Dump::Streamer; |
|
1
|
|
|
|
|
85212
|
|
|
1
|
|
|
|
|
9
|
|
8
|
1
|
|
|
1
|
|
1382
|
use JSON::XS; |
|
1
|
|
|
|
|
6927
|
|
|
1
|
|
|
|
|
317
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $j = JSON::XS->new; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
1
|
28
|
sub new { bless $_[1] => $_[0] } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub code_to_string { |
15
|
3
|
|
|
3
|
1
|
7
|
my ($self, $code) = @_; |
16
|
3
|
|
|
|
|
22
|
return sprintf 'do { my $CODE1; %s; $CODE1 } |
17
|
|
|
|
|
|
|
', |
18
|
|
|
|
|
|
|
Data::Dump::Streamer->new->Data($code)->Out; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub as_hash { |
22
|
3
|
|
|
3
|
1
|
2304
|
my ($self) = @_; |
23
|
|
|
|
|
|
|
return { |
24
|
3
|
|
|
|
|
14
|
$self->{_rev} ? (_rev => $self->{_rev}) : (), |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
_id => $self->{_id}, |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
language => 'text/perl', |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
views => { |
31
|
|
|
|
|
|
|
map { |
32
|
3
|
|
|
|
|
11
|
$_ => $self->code_to_string($self->{views}{$_}) |
33
|
3
|
50
|
|
|
|
17
|
} keys %{ $self->{views} }, |
34
|
|
|
|
|
|
|
}, |
35
|
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub as_json { |
39
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
0
|
return $j->encode($self->as_hash); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
1
|
1
|
4246
|
sub uri_id { uri_escape(shift->{_id}) } |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
__END__ |