line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ExtUtils::ModuleMaker::Siffra; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
65904
|
use 5.014; |
|
1
|
|
|
|
|
5
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
5
|
1
|
|
|
1
|
|
17
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
34
|
|
6
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
62
|
|
7
|
1
|
|
|
1
|
|
574
|
use utf8; |
|
1
|
|
|
|
|
15
|
|
|
1
|
|
|
|
|
5
|
|
8
|
1
|
|
|
1
|
|
594
|
use Data::Dumper; |
|
1
|
|
|
|
|
6575
|
|
|
1
|
|
|
|
|
71
|
|
9
|
1
|
|
|
1
|
|
428
|
use DDP; |
|
1
|
|
|
|
|
40436
|
|
|
1
|
|
|
|
|
10
|
|
10
|
1
|
|
|
1
|
|
518
|
use Log::Any qw($log); |
|
1
|
|
|
|
|
10326
|
|
|
1
|
|
|
|
|
5
|
|
11
|
1
|
|
|
1
|
|
2083
|
use Scalar::Util qw(blessed); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
64
|
|
12
|
|
|
|
|
|
|
$Carp::Verbose = 1; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
BEGIN |
16
|
|
|
|
|
|
|
{ |
17
|
1
|
|
|
1
|
|
595
|
require ExtUtils::ModuleMaker; |
18
|
1
|
|
|
1
|
|
23
|
use Exporter (); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
27
|
|
19
|
1
|
|
|
1
|
|
7
|
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
114
|
|
20
|
1
|
|
|
|
|
16422
|
$VERSION = '0.06'; |
21
|
1
|
|
|
|
|
29
|
@ISA = qw(Exporter ExtUtils::ModuleMaker); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#Give a hoot don't pollute, do not export more than needed by default |
24
|
1
|
|
|
|
|
4
|
@EXPORT = qw(); |
25
|
1
|
|
|
|
|
2
|
@EXPORT_OK = qw(); |
26
|
1
|
|
|
|
|
1493
|
%EXPORT_TAGS = (); |
27
|
|
|
|
|
|
|
} ## end BEGIN |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head3 C |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Usage : $self->block_new_method() within text_pm_file() |
32
|
|
|
|
|
|
|
Purpose : Build 'new()' method as part of a pm file |
33
|
|
|
|
|
|
|
Returns : String holding sub new. |
34
|
|
|
|
|
|
|
Argument : $module: pointer to the module being built |
35
|
|
|
|
|
|
|
(as there can be more than one module built by EU::MM); |
36
|
|
|
|
|
|
|
for the primary module it is a pointer to $self |
37
|
|
|
|
|
|
|
Throws : n/a |
38
|
|
|
|
|
|
|
Comment : This method is a likely candidate for alteration in a subclass, |
39
|
|
|
|
|
|
|
e.g., pass a single hash-ref to new() instead of a list of |
40
|
|
|
|
|
|
|
parameters. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub block_new_method |
45
|
|
|
|
|
|
|
{ |
46
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
47
|
0
|
|
|
|
|
0
|
return <<'EOFBLOCK'; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 C |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Usage : $self->block_new_method() within text_pm_file() |
52
|
|
|
|
|
|
|
Purpose : Build 'new()' method as part of a pm file |
53
|
|
|
|
|
|
|
Returns : String holding sub new. |
54
|
|
|
|
|
|
|
Argument : $module: pointer to the module being built |
55
|
|
|
|
|
|
|
(as there can be more than one module built by EU::MM); |
56
|
|
|
|
|
|
|
for the primary module it is a pointer to $self |
57
|
|
|
|
|
|
|
Throws : n/a |
58
|
|
|
|
|
|
|
Comment : This method is a likely candidate for alteration in a subclass, |
59
|
|
|
|
|
|
|
e.g., pass a single hash-ref to new() instead of a list of |
60
|
|
|
|
|
|
|
parameters. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub new |
65
|
|
|
|
|
|
|
{ |
66
|
|
|
|
|
|
|
my ($class, %parameters) = @_; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
my $self = {}; |
69
|
|
|
|
|
|
|
#my $self = $class->SUPER::new( %parameters ); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
$self = bless ($self, ref ($class) || $class); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
$log->info( "new", { progname => $0, pid => $$, perl_version => $], package => __PACKAGE__ } ); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
#$self->_initialize( %parameters ); |
76
|
|
|
|
|
|
|
return $self; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
EOFBLOCK |
80
|
|
|
|
|
|
|
} ## end sub block_new_method |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head3 C |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Usage : $self->block_begin($module) within text_pm_file() |
85
|
|
|
|
|
|
|
Purpose : Composes the standard code for top of a Perl pm file |
86
|
|
|
|
|
|
|
Returns : String holding code for top of pm file |
87
|
|
|
|
|
|
|
Argument : $module: pointer to the module being built |
88
|
|
|
|
|
|
|
(as there can be more than one module built by EU::MM); |
89
|
|
|
|
|
|
|
for the primary module it is a pointer to $self |
90
|
|
|
|
|
|
|
Throws : n/a |
91
|
|
|
|
|
|
|
Comment : This method is a likely candidate for alteration in a subclass, |
92
|
|
|
|
|
|
|
e.g., you don't need Exporter-related code if you're building |
93
|
|
|
|
|
|
|
an OO-module. |
94
|
|
|
|
|
|
|
Comment : References $self keys NAME and (indirectly) VERSION |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub block_begin |
99
|
|
|
|
|
|
|
{ |
100
|
0
|
|
|
0
|
1
|
0
|
my ( $self, $module ) = @_; |
101
|
0
|
|
|
|
|
0
|
my $version = $self->process_attribute( $module, 'VERSION' ); |
102
|
0
|
|
|
|
|
0
|
my $package_line = "package $module->{NAME};\n\n"; |
103
|
0
|
|
0
|
|
|
0
|
my $min_perl_version_line = "use " . ( $self->{ MIN_PERL_VERSION } // 5.010 ) . ";\n"; |
104
|
0
|
|
|
|
|
0
|
my $Id_line = q{#$Id#} . "\n"; |
105
|
0
|
|
|
|
|
0
|
my $strict_line = "use strict;\n"; |
106
|
0
|
|
|
|
|
0
|
my $warnings_line = "use warnings;\n"; # not included in standard version |
107
|
0
|
|
|
|
|
0
|
my $carp_line = "use Carp;\n"; |
108
|
0
|
|
|
|
|
0
|
my $carp_verbose = "\$Carp::Verbose = 1;\n"; |
109
|
0
|
|
|
|
|
0
|
my $encoding_line = "use utf8;\n"; |
110
|
0
|
|
|
|
|
0
|
my $data_dumper_line = "use Data::Dumper;\n"; |
111
|
0
|
|
|
|
|
0
|
my $log_line = "use Log::Any qw(\$log);\n"; |
112
|
0
|
|
|
|
|
0
|
my $scalar_util_line = "use Scalar::Util qw(blessed);\n"; |
113
|
0
|
|
|
|
|
0
|
my $begin_block = <<"END_OF_BEGIN"; |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
BEGIN { |
116
|
|
|
|
|
|
|
use Exporter (); |
117
|
|
|
|
|
|
|
use vars qw(\$VERSION \@ISA \@EXPORT \@EXPORT_OK \%EXPORT_TAGS); |
118
|
|
|
|
|
|
|
\$VERSION = '$version'; |
119
|
|
|
|
|
|
|
\@ISA = qw(Exporter); |
120
|
|
|
|
|
|
|
#Give a hoot don't pollute, do not export more than needed by default |
121
|
|
|
|
|
|
|
\@EXPORT = qw(); |
122
|
|
|
|
|
|
|
\@EXPORT_OK = qw(); |
123
|
|
|
|
|
|
|
\%EXPORT_TAGS = (); |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
END_OF_BEGIN |
127
|
|
|
|
|
|
|
|
128
|
0
|
|
|
|
|
0
|
my $text = $package_line; |
129
|
0
|
0
|
|
|
|
0
|
$text .= $min_perl_version_line if $self->{ MIN_PERL_VERSION }; |
130
|
0
|
0
|
|
|
|
0
|
$text .= $Id_line if $self->{ INCLUDE_ID_LINE }; |
131
|
0
|
|
|
|
|
0
|
$text .= $strict_line; |
132
|
0
|
0
|
|
|
|
0
|
$text .= $warnings_line if $self->{ INCLUDE_WARNINGS }; |
133
|
0
|
|
|
|
|
0
|
$text .= $carp_line; |
134
|
0
|
|
|
|
|
0
|
$text .= $encoding_line; |
135
|
0
|
|
|
|
|
0
|
$text .= $data_dumper_line; |
136
|
0
|
|
|
|
|
0
|
$text .= $log_line; |
137
|
0
|
|
|
|
|
0
|
$text .= $scalar_util_line; |
138
|
0
|
|
|
|
|
0
|
$text .= $carp_verbose; |
139
|
0
|
|
|
|
|
0
|
$text .= $begin_block; |
140
|
0
|
|
|
|
|
0
|
return $text; |
141
|
|
|
|
|
|
|
} ## end sub block_begin |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head3 C |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
Usage : $self->default_values() within complete_build() |
146
|
|
|
|
|
|
|
Purpose : Build Makefile |
147
|
|
|
|
|
|
|
Returns : Hash holding default_values |
148
|
|
|
|
|
|
|
Argument : n/a |
149
|
|
|
|
|
|
|
Throws : n/a |
150
|
|
|
|
|
|
|
Comment : This method is a likely candidate for alteration in a subclass |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=cut |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
sub default_values |
155
|
|
|
|
|
|
|
{ |
156
|
1
|
|
|
1
|
1
|
286
|
my $self = shift; |
157
|
1
|
|
|
|
|
9
|
my $defaults_ref = $self->SUPER::default_values(); |
158
|
|
|
|
|
|
|
|
159
|
1
|
|
|
|
|
30
|
$defaults_ref->{ AUTHOR } = 'Luiz Benevenuto'; |
160
|
1
|
|
|
|
|
5
|
$defaults_ref->{ EMAIL } = 'luiz@siffra.com.br'; |
161
|
1
|
|
|
|
|
3
|
$defaults_ref->{ CPANID } = 'LUIZBENE'; |
162
|
1
|
|
|
|
|
15
|
$defaults_ref->{ WEBSITE } = 'https://siffra.com.br'; |
163
|
1
|
|
|
|
|
5
|
$defaults_ref->{ ORGANIZATION } = 'Siffra TI'; |
164
|
|
|
|
|
|
|
|
165
|
1
|
|
|
|
|
3
|
$defaults_ref->{ VERBOSE } = 1; |
166
|
1
|
|
|
|
|
3
|
$defaults_ref->{ MIN_PERL_VERSION } = '5.014'; |
167
|
|
|
|
|
|
|
|
168
|
1
|
|
|
|
|
3
|
$defaults_ref->{ LICENSE } = 'perl'; |
169
|
1
|
|
|
|
|
2
|
$defaults_ref->{ INCLUDE_LICENSE } = 1; |
170
|
1
|
|
|
|
|
2
|
$defaults_ref->{ INCLUDE_WARNINGS } = 1; |
171
|
1
|
|
|
|
|
2
|
$defaults_ref->{ INCLUDE_MANIFEST_SKIP } = 1; |
172
|
1
|
|
|
|
|
2
|
$defaults_ref->{ INCLUDE_POD_COVERAGE_TEST } = 1; |
173
|
1
|
|
|
|
|
2
|
$defaults_ref->{ INCLUDE_POD_TEST } = 1; |
174
|
1
|
|
|
|
|
2
|
$defaults_ref->{ INCLUDE_PERLCRITIC_TEST } = 1; |
175
|
1
|
|
|
|
|
3
|
$defaults_ref->{ INCLUDE_SCRIPTS_DIRECTORY } = 1; |
176
|
1
|
|
|
|
|
2
|
$defaults_ref->{ INCLUDE_FILE_IN_PM } = '/home/luiz/.modulemaker/ExtUtils/ModuleMaker/include_module.pm'; |
177
|
|
|
|
|
|
|
|
178
|
1
|
|
|
|
|
3
|
return $defaults_ref; |
179
|
|
|
|
|
|
|
} ## end sub default_values |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head3 C |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
Usage : $self->text_Makefile() within complete_build() |
184
|
|
|
|
|
|
|
Purpose : Build Makefile |
185
|
|
|
|
|
|
|
Returns : String holding text of Makefile |
186
|
|
|
|
|
|
|
Argument : n/a |
187
|
|
|
|
|
|
|
Throws : n/a |
188
|
|
|
|
|
|
|
Comment : This method is a likely candidate for alteration in a subclass |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=cut |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
sub text_Makefile |
193
|
|
|
|
|
|
|
{ |
194
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
195
|
|
|
|
|
|
|
|
196
|
0
|
|
|
|
|
|
my %escaped = (); |
197
|
0
|
|
|
|
|
|
for my $key ( qw| NAME FILE AUTHOR EMAIL ABSTRACT LICENSE MIN_PERL_VERSION ORGANIZATION CPANID | ) |
198
|
|
|
|
|
|
|
{ |
199
|
0
|
|
|
|
|
|
my $value = $self->{ $key }; |
200
|
0
|
|
|
|
|
|
( $escaped{ $key } = $value ) =~ s{'}{\\'}g; |
201
|
|
|
|
|
|
|
} |
202
|
|
|
|
|
|
|
|
203
|
0
|
|
|
|
|
|
( my $nameFormat = $escaped{ NAME } ) =~ s{\:\:}{\-}g; |
204
|
|
|
|
|
|
|
|
205
|
0
|
|
|
|
|
|
my $text_of_Makefile = <
|
206
|
|
|
|
|
|
|
use ExtUtils::MakeMaker; |
207
|
|
|
|
|
|
|
use strict; |
208
|
|
|
|
|
|
|
use warnings; |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
# Call 'perldoc ExtUtils::MakeMaker' for details of how to influence |
211
|
|
|
|
|
|
|
# the contents of the Makefile that is written. |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
my %WriteMakefileArgs = ( |
214
|
|
|
|
|
|
|
NAME => '$escaped{NAME}', |
215
|
|
|
|
|
|
|
VERSION_FROM => '$escaped{FILE}', |
216
|
|
|
|
|
|
|
ABSTRACT_FROM => '$escaped{FILE}', |
217
|
|
|
|
|
|
|
AUTHOR => '$escaped{AUTHOR} ($escaped{EMAIL})', |
218
|
|
|
|
|
|
|
MIN_PERL_VERSION => '$escaped{MIN_PERL_VERSION}', |
219
|
|
|
|
|
|
|
LICENSE => '$escaped{LICENSE}', |
220
|
|
|
|
|
|
|
INSTALLDIRS => (\$] < 5.011 ? 'perl' : 'site'), |
221
|
|
|
|
|
|
|
PREREQ_PM => { |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
# Default req |
224
|
|
|
|
|
|
|
'strict' => 0, |
225
|
|
|
|
|
|
|
'warnings' => 0, |
226
|
|
|
|
|
|
|
'Carp' => 0, |
227
|
|
|
|
|
|
|
'utf8' => 0, |
228
|
|
|
|
|
|
|
'Data::Dumper' => 0, |
229
|
|
|
|
|
|
|
'DDP' => 0, |
230
|
|
|
|
|
|
|
'Log::Any' => 0, |
231
|
|
|
|
|
|
|
'Scalar::Util' => 0, |
232
|
|
|
|
|
|
|
'version' => 0, |
233
|
|
|
|
|
|
|
'Test::More' => 0, |
234
|
|
|
|
|
|
|
# Default req |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
}, |
237
|
|
|
|
|
|
|
BUILD_REQUIRES => { |
238
|
|
|
|
|
|
|
'Test::More' => 0, |
239
|
|
|
|
|
|
|
'ExtUtils::MakeMaker' => 0, |
240
|
|
|
|
|
|
|
}, |
241
|
|
|
|
|
|
|
( |
242
|
|
|
|
|
|
|
eval { ExtUtils::MakeMaker->VERSION(6.46) } |
243
|
|
|
|
|
|
|
? () |
244
|
|
|
|
|
|
|
: ( |
245
|
|
|
|
|
|
|
META_MERGE => { |
246
|
|
|
|
|
|
|
'meta-spec' => { version => 2 }, |
247
|
|
|
|
|
|
|
dynamic_config => 1, |
248
|
|
|
|
|
|
|
resources => { |
249
|
|
|
|
|
|
|
homepage => 'https://siffra.com.br', |
250
|
|
|
|
|
|
|
repository => { |
251
|
|
|
|
|
|
|
url => 'git\@github.com:SiffraTI/$nameFormat.git', |
252
|
|
|
|
|
|
|
web => 'https://github.com/SiffraTI/$nameFormat', |
253
|
|
|
|
|
|
|
type => 'git', |
254
|
|
|
|
|
|
|
}, |
255
|
|
|
|
|
|
|
bugtracker => { |
256
|
|
|
|
|
|
|
web => 'https://github.com/SiffraTI/$nameFormat/issues', |
257
|
|
|
|
|
|
|
}, |
258
|
|
|
|
|
|
|
}, |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
) |
261
|
|
|
|
|
|
|
), |
262
|
|
|
|
|
|
|
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, |
263
|
|
|
|
|
|
|
clean => { FILES => '$nameFormat-* *.old *.bak' }, |
264
|
|
|
|
|
|
|
); |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
WriteMakefile(\%WriteMakefileArgs); |
267
|
|
|
|
|
|
|
END_OF_MAKEFILE_TEXT |
268
|
|
|
|
|
|
|
|
269
|
0
|
|
|
|
|
|
return $text_of_Makefile; |
270
|
|
|
|
|
|
|
} ## end sub text_Makefile |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
=head3 C |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
Usage : $self->pod_wrapper($string) within block_pod() |
275
|
|
|
|
|
|
|
Purpose : When writing POD sections, you have to 'escape' |
276
|
|
|
|
|
|
|
the POD markers to prevent the compiler from treating |
277
|
|
|
|
|
|
|
them as real POD. This method 'unescapes' them and puts header |
278
|
|
|
|
|
|
|
and closer around main POD block in pm file, along with warning |
279
|
|
|
|
|
|
|
about stub documentation. |
280
|
|
|
|
|
|
|
Argument : String holding text of POD which has been built up |
281
|
|
|
|
|
|
|
within block_pod(). |
282
|
|
|
|
|
|
|
Comment : $head and $tail inside pod_wrapper() are optional and, in a |
283
|
|
|
|
|
|
|
subclass, could be redefined as empty strings; |
284
|
|
|
|
|
|
|
but $cutline is mandatory as it supplies the last =cut |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
=cut |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
sub pod_wrapper |
289
|
|
|
|
|
|
|
{ |
290
|
0
|
|
|
0
|
1
|
|
my ( $self, $podtext ) = @_; |
291
|
0
|
|
|
|
|
|
my $head = <<'END_OF_HEAD'; |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
#################### main pod documentation begin ################### |
294
|
|
|
|
|
|
|
## Below is the stub of documentation for your module. |
295
|
|
|
|
|
|
|
## You better edit it! |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
END_OF_HEAD |
298
|
|
|
|
|
|
|
|
299
|
0
|
|
|
|
|
|
my $cutline = <<'END_OF_CUT'; |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
====cut |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
END_OF_CUT |
304
|
|
|
|
|
|
|
|
305
|
0
|
|
|
|
|
|
my $tail = <<'END_OF_TAIL'; |
306
|
|
|
|
|
|
|
#################### main pod documentation end ################### |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
END_OF_TAIL |
309
|
|
|
|
|
|
|
|
310
|
0
|
|
|
|
|
|
my $encoding_section = <<'END_OF_ENCODING_SECTION'; |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
====encoding UTF-8 |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
END_OF_ENCODING_SECTION |
315
|
|
|
|
|
|
|
|
316
|
0
|
|
|
|
|
|
$cutline =~ s/\n ====/\n=/g; |
317
|
0
|
|
|
|
|
|
$encoding_section =~ s/\n ====/\n=/g; |
318
|
0
|
|
|
|
|
|
return join( |
319
|
|
|
|
|
|
|
q{}, |
320
|
|
|
|
|
|
|
$head, # optional |
321
|
|
|
|
|
|
|
$encoding_section, # optional |
322
|
|
|
|
|
|
|
$podtext, # required |
323
|
|
|
|
|
|
|
$cutline, # required |
324
|
|
|
|
|
|
|
$tail # optional |
325
|
|
|
|
|
|
|
); |
326
|
|
|
|
|
|
|
} ## end sub pod_wrapper |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=head3 C |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
Usage : $self->text_perlcritic_test() within complete_build() |
331
|
|
|
|
|
|
|
Purpose : Composes text for t/pod-coverage.t |
332
|
|
|
|
|
|
|
Returns : String with text of t/pod-coverage.t |
333
|
|
|
|
|
|
|
Argument : n/a |
334
|
|
|
|
|
|
|
Throws : n/a |
335
|
|
|
|
|
|
|
Comment : Adapted from Andy Lester's Module::Starter |
336
|
|
|
|
|
|
|
Comment : I don't think of much of this metric, but Andy and Damian do, |
337
|
|
|
|
|
|
|
so if you want it you set INCLUDE_POD_COVERAGE_TEST => 1 |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
=cut |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
sub text_perlcritic_test |
342
|
|
|
|
|
|
|
{ |
343
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
344
|
|
|
|
|
|
|
|
345
|
0
|
|
|
|
|
|
my $text_of_perlcritic_test_test = <<'END_OF_TEXT_PERLCRITIC_TEST_TEST'; |
346
|
|
|
|
|
|
|
#!perl |
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
if (!require Test::Perl::Critic) { |
349
|
|
|
|
|
|
|
Test::More::plan( |
350
|
|
|
|
|
|
|
skip_all => "Test::Perl::Critic required for testing PBP compliance" |
351
|
|
|
|
|
|
|
); |
352
|
|
|
|
|
|
|
} |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
Test::Perl::Critic::all_critic_ok(); |
355
|
|
|
|
|
|
|
END_OF_TEXT_PERLCRITIC_TEST_TEST |
356
|
|
|
|
|
|
|
|
357
|
0
|
|
|
|
|
|
return $text_of_perlcritic_test_test; |
358
|
|
|
|
|
|
|
} ## end sub text_perlcritic_test |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
=head3 C |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
Usage : $self->pod_wrapper($string) within block_pod() |
363
|
|
|
|
|
|
|
Purpose : When writing POD sections, you have to 'escape' |
364
|
|
|
|
|
|
|
the POD markers to prevent the compiler from treating |
365
|
|
|
|
|
|
|
them as real POD. This method 'unescapes' them and puts header |
366
|
|
|
|
|
|
|
and closer around main POD block in pm file, along with warning |
367
|
|
|
|
|
|
|
about stub documentation. |
368
|
|
|
|
|
|
|
Argument : String holding text of POD which has been built up |
369
|
|
|
|
|
|
|
within block_pod(). |
370
|
|
|
|
|
|
|
Comment : $head and $tail inside pod_wrapper() are optional and, in a |
371
|
|
|
|
|
|
|
subclass, could be redefined as empty strings; |
372
|
|
|
|
|
|
|
but $cutline is mandatory as it supplies the last =cut |
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
=cut |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
sub complete_build |
377
|
|
|
|
|
|
|
{ |
378
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
379
|
|
|
|
|
|
|
|
380
|
0
|
|
|
|
|
|
$self->create_base_directory(); |
381
|
|
|
|
|
|
|
|
382
|
0
|
|
|
|
|
|
$self->create_directory( map { File::Spec->catdir( $self->{ Base_Dir }, $_ ) } qw{ lib t } ); # always on |
|
0
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
|
384
|
0
|
|
|
|
|
|
$self->create_directory( map { File::Spec->catdir( $self->{ Base_Dir }, $_ ) } qw{ scripts } ) |
385
|
0
|
0
|
|
|
|
|
if $self->{ INCLUDE_SCRIPTS_DIRECTORY }; # default is on |
386
|
|
|
|
|
|
|
|
387
|
0
|
|
|
|
|
|
$self->print_file( 'README', $self->text_README() ); # always on |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
$self->print_file( 'LICENSE', $self->{ LicenseParts }{ LICENSETEXT } ) |
390
|
0
|
0
|
|
|
|
|
if $self->{ INCLUDE_LICENSE }; # default is on |
391
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
$self->print_file( 'Todo', $self->text_Todo() ) |
393
|
0
|
0
|
|
|
|
|
if $self->{ INCLUDE_TODO }; # default is on |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
$self->print_file( 'Changes', $self->text_Changes() ) |
396
|
0
|
0
|
|
|
|
|
unless ( $self->{ CHANGES_IN_POD } ); # default is off |
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
$self->print_file( 'MANIFEST.SKIP', $self->text_MANIFEST_SKIP() ) |
399
|
0
|
0
|
|
|
|
|
if $self->{ INCLUDE_MANIFEST_SKIP }; # default is off |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
$self->print_file( qq|t/pod-coverage.t|, $self->text_pod_coverage_test() ) |
402
|
0
|
0
|
|
|
|
|
if $self->{ INCLUDE_POD_COVERAGE_TEST }; # default is off |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
$self->print_file( qq|t/pod.t|, $self->text_pod_test() ) |
405
|
0
|
0
|
|
|
|
|
if $self->{ INCLUDE_POD_TEST }; # default is off |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
$self->print_file( qq|t/perlcritic.t|, $self->text_perlcritic_test() ) |
408
|
0
|
0
|
|
|
|
|
if $self->{ INCLUDE_PERLCRITIC_TEST }; # default is off |
409
|
|
|
|
|
|
|
|
410
|
0
|
0
|
|
|
|
|
if ( $self->{ BUILD_SYSTEM } eq 'ExtUtils::MakeMaker' ) |
411
|
|
|
|
|
|
|
{ |
412
|
0
|
|
|
|
|
|
$self->print_file( 'Makefile.PL', $self->text_Makefile() ); |
413
|
|
|
|
|
|
|
} |
414
|
|
|
|
|
|
|
else |
415
|
|
|
|
|
|
|
{ |
416
|
0
|
|
|
|
|
|
$self->print_file( 'Build.PL', $self->text_Buildfile() ); |
417
|
0
|
0
|
0
|
|
|
|
if ( $self->{ BUILD_SYSTEM } eq 'Module::Build and proxy Makefile.PL' |
418
|
|
|
|
|
|
|
or $self->{ BUILD_SYSTEM } eq 'Module::Build and Proxy' ) |
419
|
|
|
|
|
|
|
{ |
420
|
0
|
|
|
|
|
|
$self->print_file( 'Makefile.PL', $self->text_proxy_makefile() ); |
421
|
|
|
|
|
|
|
} |
422
|
|
|
|
|
|
|
} ## end else [ if ( $self->{ BUILD_SYSTEM...})] |
423
|
|
|
|
|
|
|
|
424
|
0
|
|
|
|
|
|
my @pmfiles = ( $self ); |
425
|
0
|
|
|
|
|
|
foreach my $f ( @{ $self->{ EXTRA_MODULES } } ) |
|
0
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
{ |
427
|
0
|
|
|
|
|
|
push @pmfiles, $f; |
428
|
|
|
|
|
|
|
} |
429
|
0
|
|
|
|
|
|
foreach my $module ( @pmfiles ) |
430
|
|
|
|
|
|
|
{ |
431
|
0
|
|
|
|
|
|
my ( $dir, $file ) = $self->_get_dir_and_file( $module ); |
432
|
0
|
|
|
|
|
|
$self->create_directory( join( '/', $self->{ Base_Dir }, $dir ) ); |
433
|
0
|
|
|
|
|
|
my $text_of_pm_file = $self->text_pm_file( $module ); |
434
|
0
|
|
|
|
|
|
$self->print_file( join( '/', $dir, $file ), $text_of_pm_file ); |
435
|
|
|
|
|
|
|
} ## end foreach my $module ( @pmfiles...) |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
# How test files are created depends on how tests for EXTRA_MODULES |
438
|
|
|
|
|
|
|
# are handled: 1 test file per extra module (default) or all tests for all |
439
|
|
|
|
|
|
|
# modules in a single file (example: PBP). |
440
|
0
|
0
|
|
|
|
|
unless ( $self->{ EXTRA_MODULES_SINGLE_TEST_FILE } ) |
441
|
|
|
|
|
|
|
{ |
442
|
0
|
|
|
|
|
|
my $ct = $self->{ FIRST_TEST_NUMBER }; |
443
|
0
|
|
|
|
|
|
foreach my $module ( @pmfiles ) |
444
|
|
|
|
|
|
|
{ |
445
|
0
|
|
|
|
|
|
my ( $teststart, $testmiddle ); |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
# Are we going to derive the lexical part of the test name from |
448
|
|
|
|
|
|
|
# the name of the module it is testing? (non-default) |
449
|
|
|
|
|
|
|
# Or are we simply going to use our pre-defined test name? |
450
|
|
|
|
|
|
|
# (default) |
451
|
0
|
0
|
|
|
|
|
if ( $self->{ TEST_NAME_DERIVED_FROM_MODULE_NAME } ) |
452
|
|
|
|
|
|
|
{ |
453
|
0
|
|
|
|
|
|
$testmiddle = $self->process_attribute( $module, 'NAME' ); |
454
|
0
|
|
|
|
|
|
$testmiddle =~ s|::|$self->{TEST_NAME_SEPARATOR}|g; |
455
|
|
|
|
|
|
|
} |
456
|
|
|
|
|
|
|
else |
457
|
|
|
|
|
|
|
{ |
458
|
0
|
|
|
|
|
|
$testmiddle = $self->{ TEST_NAME }; |
459
|
|
|
|
|
|
|
} |
460
|
|
|
|
|
|
|
# |
461
|
|
|
|
|
|
|
# Are we going to include a number at start of test name? |
462
|
|
|
|
|
|
|
# (default) If so, what is sprintf format and what character is |
463
|
|
|
|
|
|
|
# used to separate it from the lexical part of the test name? |
464
|
0
|
|
|
|
|
|
my $testfilename; |
465
|
0
|
0
|
|
|
|
|
if ( defined $self->{ TEST_NUMBER_FORMAT } ) |
466
|
|
|
|
|
|
|
{ |
467
|
0
|
|
|
|
|
|
$teststart = "t/" . $self->{ TEST_NUMBER_FORMAT } . $self->{ TEST_NAME_SEPARATOR }; |
468
|
0
|
|
|
|
|
|
$testfilename = sprintf( $teststart . $testmiddle . q{.t}, $ct ); |
469
|
|
|
|
|
|
|
} |
470
|
|
|
|
|
|
|
else |
471
|
|
|
|
|
|
|
{ |
472
|
0
|
|
|
|
|
|
$teststart = "t/"; |
473
|
0
|
|
|
|
|
|
$testfilename = $teststart . $testmiddle . q{.t}; |
474
|
|
|
|
|
|
|
} |
475
|
|
|
|
|
|
|
|
476
|
0
|
|
|
|
|
|
$self->print_file( $testfilename, $self->text_test( $testfilename, $module ) ); |
477
|
0
|
|
|
|
|
|
$ct++; |
478
|
|
|
|
|
|
|
} ## end foreach my $module ( @pmfiles...) |
479
|
|
|
|
|
|
|
} ## end unless ( $self->{ EXTRA_MODULES_SINGLE_TEST_FILE...}) |
480
|
|
|
|
|
|
|
else |
481
|
|
|
|
|
|
|
{ |
482
|
0
|
|
|
|
|
|
my ( $teststart, $testfilename ); |
483
|
0
|
0
|
|
|
|
|
if ( defined $self->{ TEST_NUMBER_FORMAT } ) |
484
|
|
|
|
|
|
|
{ |
485
|
0
|
|
|
|
|
|
$teststart = "t/" . $self->{ TEST_NUMBER_FORMAT } . $self->{ TEST_NAME_SEPARATOR }; |
486
|
0
|
|
|
|
|
|
$testfilename = sprintf( $teststart . $self->{ TEST_NAME } . q{.t}, $self->{ FIRST_TEST_NUMBER } ); |
487
|
|
|
|
|
|
|
} |
488
|
|
|
|
|
|
|
else |
489
|
|
|
|
|
|
|
{ |
490
|
0
|
|
|
|
|
|
$teststart = "t/"; |
491
|
0
|
|
|
|
|
|
$testfilename = $teststart . $self->{ TEST_NAME } . q{.t}; |
492
|
|
|
|
|
|
|
} |
493
|
0
|
|
|
|
|
|
$self->print_file( $testfilename, $self->text_test_multi( $testfilename, \@pmfiles ) ); |
494
|
|
|
|
|
|
|
} ## end else |
495
|
|
|
|
|
|
|
|
496
|
0
|
|
|
|
|
|
$self->print_file( 'MANIFEST', join( "\n", @{ $self->{ MANIFEST } } ) ); |
|
0
|
|
|
|
|
|
|
497
|
0
|
0
|
|
|
|
|
$self->make_selections_defaults() if $self->{ SAVE_AS_DEFAULTS }; |
498
|
0
|
|
|
|
|
|
return 1; |
499
|
|
|
|
|
|
|
} ## end sub complete_build |
500
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
#################### main pod documentation begin ################### |
502
|
|
|
|
|
|
|
## Below is the stub of documentation for your module. |
503
|
|
|
|
|
|
|
## You better edit it! |
504
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
=encoding UTF-8 |
506
|
|
|
|
|
|
|
|
507
|
|
|
|
|
|
|
|
508
|
|
|
|
|
|
|
=head1 NAME |
509
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
ExtUtils::ModuleMaker::Siffra - Create a module |
511
|
|
|
|
|
|
|
|
512
|
|
|
|
|
|
|
=head1 SYNOPSIS |
513
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
use ExtUtils::ModuleMaker::Siffra; |
515
|
|
|
|
|
|
|
blah blah blah |
516
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
|
518
|
|
|
|
|
|
|
=head1 DESCRIPTION |
519
|
|
|
|
|
|
|
|
520
|
|
|
|
|
|
|
Stub documentation for this module was created by ExtUtils::ModuleMaker. |
521
|
|
|
|
|
|
|
It looks like the author of the extension was negligent enough |
522
|
|
|
|
|
|
|
to leave the stub unedited. |
523
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
Blah blah blah. |
525
|
|
|
|
|
|
|
|
526
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
=head1 USAGE |
528
|
|
|
|
|
|
|
|
529
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
=head1 BUGS |
532
|
|
|
|
|
|
|
|
533
|
|
|
|
|
|
|
|
534
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
=head1 SUPPORT |
536
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
|
538
|
|
|
|
|
|
|
|
539
|
|
|
|
|
|
|
=head1 AUTHOR |
540
|
|
|
|
|
|
|
|
541
|
|
|
|
|
|
|
Luiz Benevenuto |
542
|
|
|
|
|
|
|
CPAN ID: LUIZBENE |
543
|
|
|
|
|
|
|
Siffra TI |
544
|
|
|
|
|
|
|
luiz@siffra.com.br |
545
|
|
|
|
|
|
|
https://siffra.com.br |
546
|
|
|
|
|
|
|
|
547
|
|
|
|
|
|
|
=head1 COPYRIGHT |
548
|
|
|
|
|
|
|
|
549
|
|
|
|
|
|
|
This program is free software; you can redistribute |
550
|
|
|
|
|
|
|
it and/or modify it under the same terms as Perl itself. |
551
|
|
|
|
|
|
|
|
552
|
|
|
|
|
|
|
The full text of the license can be found in the |
553
|
|
|
|
|
|
|
LICENSE file included with this module. |
554
|
|
|
|
|
|
|
|
555
|
|
|
|
|
|
|
|
556
|
|
|
|
|
|
|
=head1 SEE ALSO |
557
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
perl(1). |
559
|
|
|
|
|
|
|
|
560
|
|
|
|
|
|
|
=cut |
561
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
#################### main pod documentation end ################### |
563
|
|
|
|
|
|
|
|
564
|
|
|
|
|
|
|
1; |
565
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
# The preceding line will help the module return a true value |
567
|
|
|
|
|
|
|
|