line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ExtUtils::ModuleMaker::PBP; |
2
|
72
|
|
|
72
|
|
133188
|
use strict; |
|
72
|
|
|
|
|
161
|
|
|
72
|
|
|
|
|
3064
|
|
3
|
72
|
|
|
72
|
|
418
|
use warnings; |
|
72
|
|
|
|
|
152
|
|
|
72
|
|
|
|
|
4919
|
|
4
|
|
|
|
|
|
|
our ( $VERSION ); |
5
|
|
|
|
|
|
|
$VERSION = '0.09'; |
6
|
72
|
|
|
72
|
|
439
|
use base qw( ExtUtils::ModuleMaker ); |
|
72
|
|
|
|
|
160
|
|
|
72
|
|
|
|
|
93081
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
ExtUtils::ModuleMaker::PBP - Create a Perl extension in the style of Damian Conway's Perl Best Practices |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use ExtUtils::ModuleMaker::PBP; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$mod = ExtUtils::ModuleMaker::PBP->new( |
17
|
|
|
|
|
|
|
NAME => 'Sample::Module' |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$mod->complete_build(); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
$mod->dump_keys(qw| |
23
|
|
|
|
|
|
|
... # key provided as argument to constructor |
24
|
|
|
|
|
|
|
... # same |
25
|
|
|
|
|
|
|
|); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$mod->dump_keys_except(qw| |
28
|
|
|
|
|
|
|
... # key provided as argument to constructor |
29
|
|
|
|
|
|
|
... # same |
30
|
|
|
|
|
|
|
|); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
$license = $mod->get_license(); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
$mod->make_selections_defaults(); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 VERSION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
This document references version 0.09 of ExtUtils::ModuleMaker::PBP, released |
39
|
|
|
|
|
|
|
to CPAN on April 5, 2006. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
ExtUtils::ModuleMaker::PBP subclasses Perl extension ExtUtils::ModuleMaker. |
44
|
|
|
|
|
|
|
If you are not already familiar with ExtUtils::ModuleMaker, you should read |
45
|
|
|
|
|
|
|
its documentation I. The documentation provided below is intended |
46
|
|
|
|
|
|
|
primarily for future maintainers and extenders of ExtUtils::ModuleMaker::PBP. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
The default value settings and methods described below supersede the |
49
|
|
|
|
|
|
|
similarly named methods in ExtUtils::ModuleMaker. When used as described |
50
|
|
|
|
|
|
|
herein, they will create a CPAN-ready Perl distribution the content of |
51
|
|
|
|
|
|
|
whose files reflects programming practices recommended by Damian Conway in |
52
|
|
|
|
|
|
|
his book I (O'Reilly, 2005) |
53
|
|
|
|
|
|
|
L. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 USAGE |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
The easiest way to get started with ExtUtils::ModuleMaker::PBP is to use the |
58
|
|
|
|
|
|
|
F utility included in this distribution. F is basically a |
59
|
|
|
|
|
|
|
clone of the F utility included with F. |
60
|
|
|
|
|
|
|
To get started with F, simply go to the command-prompt and enter: |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
% mmkrpbp |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Then, answer the questions at each prompt. In many cases, you will simply |
65
|
|
|
|
|
|
|
have to type a single letter or number to make your selections. Please see |
66
|
|
|
|
|
|
|
the documentation for F and F. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 DEFAULT VALUES |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
The following default values for ExtUtils::ModuleMaker::PBP differ from |
71
|
|
|
|
|
|
|
those set in F. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=over 4 |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item * |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Default to compact top directory. E.g., F instead of |
78
|
|
|
|
|
|
|
F. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
$self->{COMPACT} = 1; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item * |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Default to placing C tests for multiple modules in a single F |
85
|
|
|
|
|
|
|
file rather than one F file for each module. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
$self->{EXTRA_MODULES_SINGLE_TEST_FILE} = 1; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=item * |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Count of F files begins at 0 rather than 1. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
$self->{FIRST_TEST_NUMBER} = 0; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item * |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
In name of test file, test number is formatted as 2-digit rather than 3-digit. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
$self->{TEST_NUMBER_FORMAT} = "%02d"; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item * |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
In name of test file, use a dot (C<.>) rather than an underscore (C<_>) to |
104
|
|
|
|
|
|
|
separate the numerical and lexical parts of the name. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
$defaults_ref->{TEST_NAME_SEPARATOR} = q{.}; |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=item * |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Do not include a Todo file in the top level of the distribution. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
$defaults_ref->{INCLUDE_TODO} = 0; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=item * |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Include F in the distribution. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
$defaults_ref->{INCLUDE_POD_COVERAGE_TEST} = 1; |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=item * |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Include F in the distribution. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
$defaults_ref->{INCLUDE_POD_TEST} = 1; |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=item * |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
Do not include directory F in the distribution. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
$defaults_ref->{INCLUDE_SCRIPTS_DIRECTORY} = 0; |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=back |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=cut |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
sub default_values { |
137
|
68
|
|
|
68
|
1
|
4627095
|
my $self = shift; |
138
|
68
|
|
|
|
|
2593
|
my $defaults_ref = $self->SUPER::default_values(); |
139
|
68
|
|
|
|
|
4661
|
$defaults_ref->{COMPACT} = 1; |
140
|
68
|
|
|
|
|
448
|
$defaults_ref->{FIRST_TEST_NUMBER} = 0; |
141
|
68
|
|
|
|
|
548
|
$defaults_ref->{TEST_NUMBER_FORMAT} = "%02d"; |
142
|
68
|
|
|
|
|
575
|
$defaults_ref->{EXTRA_MODULES_SINGLE_TEST_FILE} = 1; |
143
|
68
|
|
|
|
|
1193
|
$defaults_ref->{TEST_NAME_SEPARATOR} = q{.}; |
144
|
68
|
|
|
|
|
283
|
$defaults_ref->{INCLUDE_TODO} = 0; |
145
|
68
|
|
|
|
|
387
|
$defaults_ref->{INCLUDE_POD_COVERAGE_TEST} = 1; |
146
|
68
|
|
|
|
|
365
|
$defaults_ref->{INCLUDE_POD_TEST} = 1; |
147
|
68
|
|
|
|
|
273
|
$defaults_ref->{INCLUDE_SCRIPTS_DIRECTORY} = 0; |
148
|
68
|
|
|
|
|
350
|
return $defaults_ref;; |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=head1 METHODS |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=head2 Methods Called within C |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=head3 C |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
Usage : $self->text_Buildfile() within complete_build() |
158
|
|
|
|
|
|
|
Purpose : Composes text for a Buildfile for Module::Build |
159
|
|
|
|
|
|
|
Returns : String holding text for Buildfile |
160
|
|
|
|
|
|
|
Argument : n/a |
161
|
|
|
|
|
|
|
Throws : n/a |
162
|
|
|
|
|
|
|
Comment : References EU::MM object attributes |
163
|
|
|
|
|
|
|
NAME, LICENSE, AUTHOR, EMAIL and FILE |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=cut |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
sub text_Buildfile { |
168
|
3
|
|
|
3
|
1
|
762
|
my $self = shift; |
169
|
|
|
|
|
|
|
|
170
|
3
|
|
|
|
|
12
|
my $add_to_cleanup = $self->{NAME} . q{-*}; |
171
|
3
|
|
|
|
|
24
|
my $text_of_Buildfile = <
|
172
|
|
|
|
|
|
|
use strict; |
173
|
|
|
|
|
|
|
use warnings; |
174
|
|
|
|
|
|
|
use Module::Build; |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
my \$builder = Module::Build->new( |
177
|
|
|
|
|
|
|
module_name => '$self->{NAME}', |
178
|
|
|
|
|
|
|
license => '$self->{LICENSE}', |
179
|
|
|
|
|
|
|
dist_author => '$self->{AUTHOR} <$self->{EMAIL}>', |
180
|
|
|
|
|
|
|
dist_version_from => '$self->{FILE}', |
181
|
|
|
|
|
|
|
requires => { |
182
|
|
|
|
|
|
|
'Test::More' => 0, |
183
|
|
|
|
|
|
|
'version' => 0, |
184
|
|
|
|
|
|
|
}, |
185
|
|
|
|
|
|
|
add-to-cleanup => [ '$add_to_cleanup' ], |
186
|
|
|
|
|
|
|
); |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
\$builder->create_build_script(); |
189
|
|
|
|
|
|
|
END_OF_BUILDFILE |
190
|
3
|
|
|
|
|
15
|
return $text_of_Buildfile; |
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=head3 C |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
Usage : $self->text_Changes($only_in_pod) within complete_build; |
196
|
|
|
|
|
|
|
block_pod() |
197
|
|
|
|
|
|
|
Purpose : Composes text for Changes file |
198
|
|
|
|
|
|
|
Returns : String holding text for Changes file |
199
|
|
|
|
|
|
|
Argument : $only_in_pod: True value to get only a HISTORY section for POD |
200
|
|
|
|
|
|
|
False value to get whole Changes file |
201
|
|
|
|
|
|
|
Throws : n/a |
202
|
|
|
|
|
|
|
Comment : Accesses EU::MM object attributes |
203
|
|
|
|
|
|
|
NAME, VERSION, timestamp, eumm_version |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
=cut |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
sub text_Changes { |
208
|
50
|
|
|
50
|
1
|
160
|
my ( $self, $only_in_pod ) = @_; |
209
|
50
|
|
|
|
|
112
|
my $text_of_Changes; |
210
|
|
|
|
|
|
|
|
211
|
50
|
|
|
|
|
954
|
my $text_of_Changes_core = <
|
212
|
|
|
|
|
|
|
$self->{VERSION} $self->{timestamp} |
213
|
|
|
|
|
|
|
- Initial release. Created by ExtUtils::ModuleMaker $self->{eumm_version}. |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
END_OF_CHANGES |
216
|
|
|
|
|
|
|
|
217
|
50
|
50
|
|
|
|
384
|
unless ($only_in_pod) { |
218
|
50
|
|
|
|
|
333
|
$text_of_Changes = <
|
219
|
|
|
|
|
|
|
Revision history for $self->{NAME} |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
$text_of_Changes_core |
222
|
|
|
|
|
|
|
EOF |
223
|
|
|
|
|
|
|
} |
224
|
|
|
|
|
|
|
else { |
225
|
0
|
|
|
|
|
0
|
$text_of_Changes = $text_of_Changes_core; |
226
|
|
|
|
|
|
|
} |
227
|
|
|
|
|
|
|
|
228
|
50
|
|
|
|
|
322
|
return $text_of_Changes; |
229
|
|
|
|
|
|
|
} |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
=head3 C |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
Usage : $self->text_Makefile() within complete_build() |
234
|
|
|
|
|
|
|
Purpose : Build Makefile |
235
|
|
|
|
|
|
|
Returns : String holding text of Makefile |
236
|
|
|
|
|
|
|
Argument : n/a |
237
|
|
|
|
|
|
|
Throws : n/a |
238
|
|
|
|
|
|
|
Comment : References EU::MM object attributes |
239
|
|
|
|
|
|
|
NAME, AUTHOR, EMAIL and FILE |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=cut |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
sub text_Makefile { |
244
|
51
|
|
|
51
|
1
|
27817
|
my $self = shift; |
245
|
51
|
|
|
|
|
233
|
my $Makefile_format = q~ |
246
|
|
|
|
|
|
|
use strict; |
247
|
|
|
|
|
|
|
use warnings; |
248
|
|
|
|
|
|
|
use ExtUtils::MakeMaker; |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
WriteMakefile( |
251
|
|
|
|
|
|
|
NAME => '%s', |
252
|
|
|
|
|
|
|
AUTHOR => '%s <%s>', |
253
|
|
|
|
|
|
|
VERSION_FROM => '%s', |
254
|
|
|
|
|
|
|
ABSTRACT_FROM => '%s', |
255
|
|
|
|
|
|
|
PL_FILES => {}, |
256
|
|
|
|
|
|
|
PREREQ_PM => { |
257
|
|
|
|
|
|
|
'Test::More' => 0, |
258
|
|
|
|
|
|
|
'version' => 0, |
259
|
|
|
|
|
|
|
}, |
260
|
|
|
|
|
|
|
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, |
261
|
|
|
|
|
|
|
clean => { FILES => '%s-*' }, |
262
|
|
|
|
|
|
|
); |
263
|
|
|
|
|
|
|
~; |
264
|
306
|
|
|
|
|
513
|
my $text_of_Makefile = sprintf $Makefile_format, |
265
|
51
|
|
|
|
|
294
|
map { my $s = $_; $s =~ s{'}{\\'}g; $s; } |
|
306
|
|
|
|
|
857
|
|
|
306
|
|
|
|
|
998
|
|
266
|
|
|
|
|
|
|
$self->{NAME}, |
267
|
|
|
|
|
|
|
$self->{AUTHOR}, |
268
|
|
|
|
|
|
|
$self->{EMAIL}, |
269
|
|
|
|
|
|
|
$self->{FILE}, |
270
|
|
|
|
|
|
|
$self->{FILE}, |
271
|
|
|
|
|
|
|
$self->{FILE}; |
272
|
51
|
|
|
|
|
320
|
return $text_of_Makefile; |
273
|
|
|
|
|
|
|
} |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
=head3 C |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
Usage : $self->text_README() within complete_build() |
278
|
|
|
|
|
|
|
Purpose : Build README |
279
|
|
|
|
|
|
|
Returns : String holding text of README |
280
|
|
|
|
|
|
|
Argument : n/a |
281
|
|
|
|
|
|
|
Throws : n/a |
282
|
|
|
|
|
|
|
Comment : References EU::MM object attributes |
283
|
|
|
|
|
|
|
NAME, VERSION, COPYRIGHT_YEAR and AUTHOR |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
=cut |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
sub text_README { |
288
|
54
|
|
|
54
|
1
|
157130
|
my $self = shift; |
289
|
|
|
|
|
|
|
|
290
|
54
|
|
|
|
|
441
|
my $README_top = <<"END_OF_TOP"; |
291
|
|
|
|
|
|
|
$self->{NAME} version $self->{VERSION} |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
[ REPLACE THIS... |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
The README is used to introduce the module and provide instructions on |
296
|
|
|
|
|
|
|
how to install the module, any machine dependencies it may have (for |
297
|
|
|
|
|
|
|
example C compilers and installed libraries) and any other information |
298
|
|
|
|
|
|
|
that should be understood before the module is installed. |
299
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
A README file is required for CPAN modules since CPAN extracts the |
301
|
|
|
|
|
|
|
README file from a module distribution so that people browsing the |
302
|
|
|
|
|
|
|
archive can use it get an idea of the modules uses. It is usually a |
303
|
|
|
|
|
|
|
good idea to provide version information here so that people can |
304
|
|
|
|
|
|
|
decide whether fixes for the module are worth downloading. |
305
|
|
|
|
|
|
|
] |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
INSTALLATION |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
To install this module, run the following commands: |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
END_OF_TOP |
313
|
|
|
|
|
|
|
|
314
|
54
|
|
|
|
|
210
|
my $makemaker_instructions = <<'END_OF_MAKE'; |
315
|
|
|
|
|
|
|
perl Makefile.PL |
316
|
|
|
|
|
|
|
make |
317
|
|
|
|
|
|
|
make test |
318
|
|
|
|
|
|
|
make install |
319
|
|
|
|
|
|
|
END_OF_MAKE |
320
|
|
|
|
|
|
|
|
321
|
54
|
|
|
|
|
208
|
my $mb_instructions = <<'END_OF_BUILD'; |
322
|
|
|
|
|
|
|
perl Build.PL |
323
|
|
|
|
|
|
|
./Build |
324
|
|
|
|
|
|
|
./Build test |
325
|
|
|
|
|
|
|
./Build install |
326
|
|
|
|
|
|
|
END_OF_BUILD |
327
|
|
|
|
|
|
|
|
328
|
54
|
|
|
|
|
180
|
my $README_middle = <<'END_OF_MIDDLE'; |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
Alternatively, to install with Module::Build, you can use the |
331
|
|
|
|
|
|
|
following commands: |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
END_OF_MIDDLE |
334
|
|
|
|
|
|
|
|
335
|
54
|
|
|
|
|
441
|
my $README_bottom = <<"END_OF_README"; |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
DEPENDENCIES |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
None. |
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
COPYRIGHT AND LICENSE |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
Copyright (C) $self->{COPYRIGHT_YEAR}, $self->{AUTHOR} |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
348
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
349
|
|
|
|
|
|
|
END_OF_README |
350
|
|
|
|
|
|
|
|
351
|
54
|
|
|
|
|
1368
|
return $README_top . |
352
|
|
|
|
|
|
|
$makemaker_instructions . |
353
|
|
|
|
|
|
|
$README_middle . |
354
|
|
|
|
|
|
|
$mb_instructions . |
355
|
|
|
|
|
|
|
$README_bottom; |
356
|
|
|
|
|
|
|
} |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
=head3 C |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
Usage : $self->text_pm_file($module) within generate_pm_file() |
361
|
|
|
|
|
|
|
Purpose : Composes a string holding all elements for a pm file |
362
|
|
|
|
|
|
|
Returns : String holding text for a *.pm file |
363
|
|
|
|
|
|
|
Argument : $module: pointer to the module being built |
364
|
|
|
|
|
|
|
(as there can be more than one module built by EU::MM); |
365
|
|
|
|
|
|
|
for the primary module it is a pointer to $self |
366
|
|
|
|
|
|
|
Comment : References EU::MM object attributes |
367
|
|
|
|
|
|
|
NAME, AUTHOR, EMAIL and COPYRIGHT_YEAR |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
=cut |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
sub text_pm_file { |
372
|
60
|
|
|
60
|
1
|
26449
|
my $self = shift; |
373
|
60
|
|
|
|
|
160
|
my $module = shift; |
374
|
|
|
|
|
|
|
|
375
|
60
|
|
|
|
|
208
|
my $rt_name = $self->{NAME}; |
376
|
60
|
|
|
|
|
409
|
$rt_name =~ s{::}{-}g; |
377
|
|
|
|
|
|
|
|
378
|
60
|
|
|
|
|
1111
|
my $text_of_pm_file = <<"END_OF_PM_FILE"; |
379
|
|
|
|
|
|
|
package $self->{NAME}; |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
use version; \$VERSION = qv('$self->{VERSION}'); |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
use warnings; |
384
|
|
|
|
|
|
|
use strict; |
385
|
|
|
|
|
|
|
use Carp; |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
# Other recommended modules (uncomment to use): |
388
|
|
|
|
|
|
|
# use IO::Prompt; |
389
|
|
|
|
|
|
|
# use Perl6::Export; |
390
|
|
|
|
|
|
|
# use Perl6::Slurp; |
391
|
|
|
|
|
|
|
# use Perl6::Say; |
392
|
|
|
|
|
|
|
# use Regexp::Autoflags; |
393
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
# Module implementation here |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
1; # Magic true value required at end of module |
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
====head1 NAME |
401
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
$self->{NAME} - [One line description of module's purpose here] |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
====head1 VERSION |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
This document describes $self->{NAME} version 0.0.1 |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
====head1 SYNOPSIS |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
use $self->{NAME}; |
413
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
====for author_to_fill_in |
415
|
|
|
|
|
|
|
Brief code example(s) here showing commonest usage(s). |
416
|
|
|
|
|
|
|
This section will be as far as many users bother reading |
417
|
|
|
|
|
|
|
so make it as educational and exeplary as possible. |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
====head1 DESCRIPTION |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
====for author_to_fill_in |
422
|
|
|
|
|
|
|
Write a full description of the module and its features here. |
423
|
|
|
|
|
|
|
Use subsections (=head2, =head3) as appropriate. |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
====head1 INTERFACE |
427
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
====for author_to_fill_in |
429
|
|
|
|
|
|
|
Write a separate section listing the public components of the modules |
430
|
|
|
|
|
|
|
interface. These normally consist of either subroutines that may be |
431
|
|
|
|
|
|
|
exported, or methods that may be called on objects belonging to the |
432
|
|
|
|
|
|
|
classes provided by the module. |
433
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
====head1 DIAGNOSTICS |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
====for author_to_fill_in |
438
|
|
|
|
|
|
|
List every single error and warning message that the module can |
439
|
|
|
|
|
|
|
generate (even the ones that will ''never happen''), with a full |
440
|
|
|
|
|
|
|
explanation of each problem, one or more likely causes, and any |
441
|
|
|
|
|
|
|
suggested remedies. |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
====over |
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
====item C<< Error message here, perhaps with \%s placeholders >> |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
[Description of error here] |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
====item C<< Another error message here >> |
450
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
[Description of error here] |
452
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
[Et cetera, et cetera] |
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
====back |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
====head1 CONFIGURATION AND ENVIRONMENT |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
====for author_to_fill_in |
461
|
|
|
|
|
|
|
A full explanation of any configuration system(s) used by the |
462
|
|
|
|
|
|
|
module, including the names and locations of any configuration |
463
|
|
|
|
|
|
|
files, and the meaning of any environment variables or properties |
464
|
|
|
|
|
|
|
that can be set. These descriptions must also include details of any |
465
|
|
|
|
|
|
|
configuration language used. |
466
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
$self->{NAME} requires no configuration files or environment variables. |
468
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
====head1 DEPENDENCIES |
471
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
====for author_to_fill_in |
473
|
|
|
|
|
|
|
A list of all the other modules that this module relies upon, |
474
|
|
|
|
|
|
|
including any restrictions on versions, and an indication whether |
475
|
|
|
|
|
|
|
the module is part of the standard Perl distribution, part of the |
476
|
|
|
|
|
|
|
module's distribution, or must be installed separately. ] |
477
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
None. |
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
====head1 INCOMPATIBILITIES |
482
|
|
|
|
|
|
|
|
483
|
|
|
|
|
|
|
====for author_to_fill_in |
484
|
|
|
|
|
|
|
A list of any modules that this module cannot be used in conjunction |
485
|
|
|
|
|
|
|
with. This may be due to name conflicts in the interface, or |
486
|
|
|
|
|
|
|
competition for system or program resources, or due to internal |
487
|
|
|
|
|
|
|
limitations of Perl (for example, many modules that use source code |
488
|
|
|
|
|
|
|
filters are mutually incompatible). |
489
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
None reported. |
491
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
====head1 BUGS AND LIMITATIONS |
494
|
|
|
|
|
|
|
|
495
|
|
|
|
|
|
|
====for author_to_fill_in |
496
|
|
|
|
|
|
|
A list of known problems with the module, together with some |
497
|
|
|
|
|
|
|
indication Whether they are likely to be fixed in an upcoming |
498
|
|
|
|
|
|
|
release. Also a list of restrictions on the features the module |
499
|
|
|
|
|
|
|
does provide: data types that cannot be handled, performance issues |
500
|
|
|
|
|
|
|
and the circumstances in which they may arise, practical |
501
|
|
|
|
|
|
|
limitations on the size of data sets, special cases that are not |
502
|
|
|
|
|
|
|
(yet) handled, etc. |
503
|
|
|
|
|
|
|
|
504
|
|
|
|
|
|
|
No bugs have been reported. |
505
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
507
|
|
|
|
|
|
|
C, or through the web interface at |
508
|
|
|
|
|
|
|
L. |
509
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
====head1 AUTHOR |
512
|
|
|
|
|
|
|
|
513
|
|
|
|
|
|
|
$self->{AUTHOR} C<< $self->{EMAIL} >> |
514
|
|
|
|
|
|
|
|
515
|
|
|
|
|
|
|
|
516
|
|
|
|
|
|
|
====head1 LICENSE AND COPYRIGHT |
517
|
|
|
|
|
|
|
|
518
|
|
|
|
|
|
|
Copyright (c) $self->{COPYRIGHT_YEAR}, $self->{AUTHOR} C<< $self->{EMAIL} >>. |
519
|
|
|
|
|
|
|
All rights reserved. |
520
|
|
|
|
|
|
|
|
521
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or |
522
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. See C. |
523
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
====head1 DISCLAIMER OF WARRANTY |
526
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
528
|
|
|
|
|
|
|
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
529
|
|
|
|
|
|
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES |
530
|
|
|
|
|
|
|
PROVIDE THE SOFTWARE ''AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER |
531
|
|
|
|
|
|
|
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
532
|
|
|
|
|
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE |
533
|
|
|
|
|
|
|
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH |
534
|
|
|
|
|
|
|
YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL |
535
|
|
|
|
|
|
|
NECESSARY SERVICING, REPAIR, OR CORRECTION. |
536
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
538
|
|
|
|
|
|
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
539
|
|
|
|
|
|
|
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE |
540
|
|
|
|
|
|
|
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, |
541
|
|
|
|
|
|
|
OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE |
542
|
|
|
|
|
|
|
THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING |
543
|
|
|
|
|
|
|
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A |
544
|
|
|
|
|
|
|
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF |
545
|
|
|
|
|
|
|
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
546
|
|
|
|
|
|
|
SUCH DAMAGES. |
547
|
|
|
|
|
|
|
END_OF_PM_FILE |
548
|
|
|
|
|
|
|
|
549
|
60
|
|
|
|
|
19160
|
$text_of_pm_file =~ s/\n ====/\n=/g; |
550
|
60
|
|
|
|
|
319
|
return ($module, $text_of_pm_file); |
551
|
|
|
|
|
|
|
} |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
=head1 PREREQUISITES |
554
|
|
|
|
|
|
|
|
555
|
|
|
|
|
|
|
ExtUtils::ModuleMaker, version 0.40 or later. |
556
|
|
|
|
|
|
|
L. |
557
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
=head1 INCOMPATIBILITIES |
559
|
|
|
|
|
|
|
|
560
|
|
|
|
|
|
|
None reported. |
561
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
563
|
|
|
|
|
|
|
|
564
|
|
|
|
|
|
|
No bugs have been reported. |
565
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
567
|
|
|
|
|
|
|
C, or through the web interface at |
568
|
|
|
|
|
|
|
L. |
569
|
|
|
|
|
|
|
|
570
|
|
|
|
|
|
|
|
571
|
|
|
|
|
|
|
=head1 AUTHOR |
572
|
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
James E Keenan: jkeenan [at] cpan [dot] org |
574
|
|
|
|
|
|
|
|
575
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
576
|
|
|
|
|
|
|
|
577
|
|
|
|
|
|
|
Standard text of files created by ExtUtils::ModuleMaker::PBP copyright (c) |
578
|
|
|
|
|
|
|
2005 Damian Conway. Adapted from Module::Starter::PBP and used by permission. |
579
|
|
|
|
|
|
|
Code building these files copyright (c) 2005 James E Keenan. |
580
|
|
|
|
|
|
|
All rights reserved. |
581
|
|
|
|
|
|
|
|
582
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or |
583
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. See C. |
584
|
|
|
|
|
|
|
|
585
|
|
|
|
|
|
|
|
586
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTY |
587
|
|
|
|
|
|
|
|
588
|
|
|
|
|
|
|
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
589
|
|
|
|
|
|
|
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
590
|
|
|
|
|
|
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES |
591
|
|
|
|
|
|
|
PROVIDE THE SOFTWARE ''AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER |
592
|
|
|
|
|
|
|
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
593
|
|
|
|
|
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE |
594
|
|
|
|
|
|
|
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH |
595
|
|
|
|
|
|
|
YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL |
596
|
|
|
|
|
|
|
NECESSARY SERVICING, REPAIR, OR CORRECTION. |
597
|
|
|
|
|
|
|
|
598
|
|
|
|
|
|
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
599
|
|
|
|
|
|
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
600
|
|
|
|
|
|
|
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE |
601
|
|
|
|
|
|
|
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, |
602
|
|
|
|
|
|
|
OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE |
603
|
|
|
|
|
|
|
THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING |
604
|
|
|
|
|
|
|
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A |
605
|
|
|
|
|
|
|
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF |
606
|
|
|
|
|
|
|
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
607
|
|
|
|
|
|
|
SUCH DAMAGES. |
608
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
=head1 SEE ALSO |
610
|
|
|
|
|
|
|
|
611
|
|
|
|
|
|
|
F, F, F. |
612
|
|
|
|
|
|
|
|
613
|
|
|
|
|
|
|
=cut |
614
|
|
|
|
|
|
|
|
615
|
|
|
|
|
|
|
1; |
616
|
|
|
|
|
|
|
# The preceding line will help the module return a true value |