line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Table::Simple::Output::Theory; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
539
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
4
|
1
|
|
|
1
|
|
6939
|
use Moose::Util::TypeConstraints; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
5
|
1
|
|
|
1
|
|
2194
|
use namespace::autoclean; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
81
|
use Carp qw(carp); |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
135
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
extends 'Table::Simple::Output'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Table::Simple::Output::Theory - Use the "theory" table format to output table data. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Theory is named after David "theory" Wheeler who provided a table format |
18
|
|
|
|
|
|
|
for the "Markdown" wiki text format (which just happens to match the |
19
|
|
|
|
|
|
|
standard output for PostgreSQL queries.) |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
It also provides a nice example of how to subclass L<Table::Simple::Output> |
22
|
|
|
|
|
|
|
to control or change how data is output. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Most of the magic to make this work is embedded inside of L<Moose>. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head2 ATTRIBUTES |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
The following attributes from L<Table::Simple::Output> have been overriden |
29
|
|
|
|
|
|
|
in this subclass: |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=over 4 |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=item column_marker |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
The default is "|" |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=back |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
has '+column_marker' => ( |
42
|
|
|
|
|
|
|
default => '|', |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=over 4 |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=item horizontal_rule |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
The default is "-" |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=back |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
has '+horizontal_rule' => ( |
56
|
|
|
|
|
|
|
default => '-', |
57
|
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=over 4 |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item padding |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
The default is 2. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=back |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
has '+padding' => ( |
70
|
|
|
|
|
|
|
default => 2, |
71
|
|
|
|
|
|
|
); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 LICENSE |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Copyright (C) 2010 Mark Allen |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
78
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
79
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 AUTHOR |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Mark Allen <mrallen1@yahoo.com> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 SEE ALSO |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
L<Moose>, L<Markdent>, L<Table::Simple>, L<Table::Simple::Output> |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
94
|
|
|
|
|
|
|
1; |