line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (C) 2003-2007, G. Allen Morris III, all rights reserved |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
39
|
use strict; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
268
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package |
6
|
|
|
|
|
|
|
Data::Tabular::Output; |
7
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
32
|
use Carp qw (croak); |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
620
|
|
9
|
|
|
|
|
|
|
|
10
|
6
|
|
|
6
|
|
36
|
use overload '""' => \&render; |
|
6
|
|
|
|
|
157
|
|
|
6
|
|
|
|
|
70
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new |
13
|
|
|
|
|
|
|
{ |
14
|
1
|
|
|
1
|
0
|
3
|
my $class = shift; |
15
|
1
|
|
|
|
|
3
|
my $args = { @_ }; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
3
|
my $self = bless {}, $class; |
18
|
|
|
|
|
|
|
|
19
|
1
|
50
|
|
|
|
4
|
die 'No table' unless $args->{table}; |
20
|
1
|
|
|
|
|
69
|
$self->{table} = $args->{table}; |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
33
|
|
|
5
|
$self->{output} = $args->{output} || croak "Need output"; |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
5
|
$self; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub rows |
28
|
|
|
|
|
|
|
{ |
29
|
12
|
|
|
12
|
0
|
25
|
my $self = shift; |
30
|
|
|
|
|
|
|
|
31
|
12
|
|
|
|
|
46
|
$self->{table}->rows(output => $self->output); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub columns |
35
|
|
|
|
|
|
|
{ |
36
|
5
|
|
|
5
|
0
|
11
|
my $self = shift; |
37
|
|
|
|
|
|
|
|
38
|
5
|
|
|
|
|
20
|
$self->{table}->columns(output => $self->output); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub output |
42
|
|
|
|
|
|
|
{ |
43
|
355
|
|
|
355
|
0
|
573
|
my $self = shift; |
44
|
355
|
|
|
|
|
1455
|
$self->{output}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub table |
48
|
|
|
|
|
|
|
{ |
49
|
1
|
|
|
1
|
0
|
30
|
my $self = shift; |
50
|
1
|
|
|
|
|
5
|
$self->{table}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub attrib |
54
|
|
|
|
|
|
|
{ |
55
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
warn $self->output; |
58
|
0
|
|
|
|
|
|
warn keys %{$self->output}; |
|
0
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
0
|
0
|
|
|
|
|
if (my $href = $self->output->{html}) { |
61
|
0
|
|
|
|
|
|
warn 'HRef ', $href; |
62
|
0
|
|
|
|
|
|
$href->{attributes} = {}; |
63
|
0
|
|
|
|
|
|
my $new_attributes = { |
64
|
0
|
|
|
|
|
|
%{$href->{attributes}}, |
65
|
|
|
|
|
|
|
@_, |
66
|
|
|
|
|
|
|
}; |
67
|
0
|
|
|
|
|
|
$href->{attributes} = $new_attributes; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
$self; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub render |
74
|
|
|
|
|
|
|
{ |
75
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
76
|
0
|
|
|
|
|
|
$self->text; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |
80
|
|
|
|
|
|
|
__END__ |