line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Install::DBICx::AutoDoc; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
0
|
|
|
|
|
|
BEGIN { |
5
|
3
|
|
|
3
|
|
34520
|
use 5.004; |
|
3
|
|
|
|
|
9
|
|
6
|
3
|
|
|
3
|
|
14
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
72
|
|
7
|
3
|
|
|
3
|
|
7
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
78
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
9
|
use Carp qw/croak/; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
223
|
|
10
|
3
|
|
|
3
|
|
1216
|
use Data::Dump qw/dump/; |
|
3
|
|
|
|
|
14922
|
|
|
3
|
|
|
|
|
185
|
|
11
|
3
|
|
|
3
|
|
1360
|
use DBICx::AutoDoc; # if this fails this module fails |
|
3
|
|
|
|
|
288920
|
|
|
3
|
|
|
|
|
101
|
|
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
18
|
use base 'Module::Install::Base'; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
1363
|
|
14
|
|
|
|
|
|
|
|
15
|
3
|
|
|
3
|
|
956
|
our $VERSION = '0.01_02'; |
16
|
3
|
|
|
3
|
|
18
|
use vars qw/$SCHEMA $AUTODOC_OUTPUT/; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
140
|
|
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 NAME |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Module::Install::DBICx::AutoDoc - Use your Makefile to run DBICx::AutoDoc |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 VERSION |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Version 0.01_02 - functional preview release |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 SYNOPSIS |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
In MakeFile.PL: |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
dbicx_autodoc('doc'); # use name() or module_name() as Schema package |
32
|
|
|
|
|
|
|
# or |
33
|
|
|
|
|
|
|
dbix_autodoc('doc','My::Schema'); # better be in lib/ |
34
|
|
|
|
|
|
|
# or |
35
|
|
|
|
|
|
|
dbix_autodoc({ |
36
|
|
|
|
|
|
|
output => 'doc', |
37
|
|
|
|
|
|
|
schema => 'My::Schema' |
38
|
|
|
|
|
|
|
}); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
From CLI: |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
make autodoc |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 METHODS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 dbicx_autodoc |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Add a DBICx::AutoDoc call to a Makefile |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Example (in Makefile.PL): |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
name 'My-Schema'; |
53
|
|
|
|
|
|
|
all_from 'lib/My/Schema.pm'; |
54
|
|
|
|
|
|
|
author 'Foo Bar'; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
dbicx_autodoc('doc'); # use name() or module_name() as Schema package |
57
|
|
|
|
|
|
|
# or |
58
|
|
|
|
|
|
|
dbix_autodoc('doc','My::Schema'); # better be in lib/ |
59
|
|
|
|
|
|
|
# or |
60
|
|
|
|
|
|
|
dbix_autodoc({ |
61
|
|
|
|
|
|
|
output => 'doc', |
62
|
|
|
|
|
|
|
schema => 'My::Schema' |
63
|
|
|
|
|
|
|
}); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This would run DBICx::AutoDoc for My::Schema and store documents in /doc. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub dbicx_autodoc { |
70
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
71
|
|
|
|
|
|
|
|
72
|
0
|
0
|
|
|
|
|
return unless $Module::Install::AUTHOR; |
73
|
|
|
|
|
|
|
|
74
|
0
|
0
|
0
|
|
|
|
die "First argrument to 'dbicx_autodoc' must be either an output directory or a HASH ref" |
75
|
|
|
|
|
|
|
unless ref($_[0]) eq 'HASH' or !ref($_[0]); |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# if our fix argrument (after self) is a hash ref use that as |
78
|
|
|
|
|
|
|
# our constructor for DBICx::AutoDoc else use our first argrument |
79
|
|
|
|
|
|
|
# as our output directory for DBICx::Schema |
80
|
|
|
|
|
|
|
# if our first argrument is not a hash and is not defined |
81
|
|
|
|
|
|
|
# use our module_name or name from Module::Install after |
82
|
|
|
|
|
|
|
# replacing '-' with '::' |
83
|
|
|
|
|
|
|
|
84
|
0
|
0
|
|
|
|
|
my %args = ref $_[0] eq 'HASH'? %{$_[0]} : ( |
|
0
|
0
|
|
|
|
|
|
85
|
|
|
|
|
|
|
schema => defined $_[1]? $_[1] : $self->_get_fixed_module(), |
86
|
|
|
|
|
|
|
output => $_[0] |
87
|
|
|
|
|
|
|
); |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
$SCHEMA = $args{schema}; |
90
|
0
|
|
|
|
|
|
$AUTODOC_OUTPUT = $args{$output}; |
91
|
|
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
my $m = $self->mk_makecmds(\%args); |
93
|
0
|
|
|
|
|
|
return $self->postamble($m); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head2 mk_makecmds |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Generates our our Makefile statements |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=cut |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub mk_makecmds { |
103
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
104
|
0
|
|
|
|
|
|
my $hash = shift; |
105
|
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
$self->_ck_hash($hash); |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
return qq/autodoc :: all\n/. |
109
|
|
|
|
|
|
|
qq/\t\$(PERLRUN) -I\$(INST_LIB) -MDBICx::AutoDoc -e '/. |
110
|
|
|
|
|
|
|
$self->gen_dbicxautodoc(). |
111
|
|
|
|
|
|
|
qq/'\n\ndistclean :: autodoc_clean\n\n/. |
112
|
|
|
|
|
|
|
qq/autodoc_clean:\n\t\$(RM_RF) /.$hash->{output}. |
113
|
0
|
|
|
|
|
|
qq/\n\n/; |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head2 gen_dbicxautodoc |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Generates or DBICx::AutoDoc command line call |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=cut |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub gen_dbicxautodoc { |
123
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
124
|
0
|
|
|
|
|
|
my $hash = shift; |
125
|
|
|
|
|
|
|
|
126
|
0
|
|
|
|
|
|
$self->_ck_hash($hash); |
127
|
|
|
|
|
|
|
|
128
|
0
|
|
|
|
|
|
my $str = Data::Dump::dump($hash); |
129
|
0
|
|
|
|
|
|
return qq/my %h = $str; my \$a = DBICx::AutoDoc->new(%h)/; |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub _ck_hash { |
133
|
0
|
|
|
0
|
|
|
my $self = shift; |
134
|
0
|
|
|
|
|
|
my $hash = shift; |
135
|
|
|
|
|
|
|
|
136
|
0
|
0
|
|
|
|
|
croak "Recieved an ".ref($hash)." ref when we expected a HASH ref" |
137
|
|
|
|
|
|
|
unless ref($hash) eq 'HASH'; |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
sub _get_fixed_module { |
142
|
0
|
|
|
0
|
|
|
my $self = shift; |
143
|
0
|
0
|
|
|
|
|
return join('::',split(/-/, |
144
|
|
|
|
|
|
|
($self->module_name? $self->module_name : $self->name ) |
145
|
|
|
|
|
|
|
)); |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head1 AUTHOR |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
Jason M. Mills, C<< >> |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=head1 BUGS |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
156
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
157
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=head1 SUPPORT |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
perldoc Module::Install::DBICx::AutoDoc |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
You can also look for information at: |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=over 4 |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
L |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
L |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=item * CPAN Ratings |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
L |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=item * Search CPAN |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
L |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=back |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=head1 SEE ALSO |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
Module::Install, Module::Install::AutoManifest |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
Copyright 2008 Jason M. Mills |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
197
|
|
|
|
|
|
|
under the same terms as Perl itself. |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=cut |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
1; # End of Module::Install::DBICx::AutoDoc |
202
|
|
|
|
|
|
|
|