line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- mode: perl; c-basic-offset: 4; indent-tabs-mode: nil; -*- |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
386
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
678
|
use ExtUtils::MakeMaker qw(WriteMakefile); |
|
1
|
|
|
|
|
91242
|
|
|
1
|
|
|
|
|
1074
|
|
5
|
|
|
|
|
|
|
# See lib/ExtUtils/MakeMaker.pm for details of how to influence |
6
|
|
|
|
|
|
|
# the contents of the Makefile that is written. |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# Normalize version strings like 6.30_02 to 6.3002, |
9
|
|
|
|
|
|
|
# so that we can do numerical comparisons on it. |
10
|
|
|
|
|
|
|
my $eumm_version = $ExtUtils::MakeMaker::VERSION; |
11
|
|
|
|
|
|
|
$eumm_version =~ s/_//; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $module = 'Mojolicious::Matterbridge'; |
14
|
|
|
|
|
|
|
(my $main_file = "lib/$module.pm" ) =~ s!::!/!g; |
15
|
|
|
|
|
|
|
(my $distbase = $module) =~ s!::!-!g; |
16
|
|
|
|
|
|
|
my $distlink = $distbase; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my @tests = map { glob $_ } 't/*.t', 't/*/*.t'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my %module = ( |
21
|
|
|
|
|
|
|
NAME => $module, |
22
|
|
|
|
|
|
|
AUTHOR => q{Max Maischein }, |
23
|
|
|
|
|
|
|
VERSION_FROM => $main_file, |
24
|
|
|
|
|
|
|
ABSTRACT_FROM => $main_file, |
25
|
|
|
|
|
|
|
META_MERGE => { |
26
|
|
|
|
|
|
|
"meta-spec" => { version => 2 }, |
27
|
|
|
|
|
|
|
resources => { |
28
|
|
|
|
|
|
|
repository => { |
29
|
|
|
|
|
|
|
web => "https://github.com/Corion/$distlink", |
30
|
|
|
|
|
|
|
url => "git://github.com/Corion/$distlink.git", |
31
|
|
|
|
|
|
|
type => 'git', |
32
|
|
|
|
|
|
|
}, |
33
|
|
|
|
|
|
|
bugtracker => { |
34
|
|
|
|
|
|
|
web => "http://github.com/Corion/$distbase/issues", |
35
|
|
|
|
|
|
|
# mailto => 'meta-bugs@example.com', |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
license => "https://dev.perl.org/licenses/", |
38
|
|
|
|
|
|
|
}, |
39
|
|
|
|
|
|
|
dynamic_config => 0, # we promise to keep META.* up-to-date |
40
|
|
|
|
|
|
|
x_static_install => 1, # we are pure Perl and don't do anything fancy |
41
|
|
|
|
|
|
|
}, |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
MIN_PERL_VERSION => '5.016', # I use s///r in some places |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
'LICENSE'=> 'perl', |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
PL_FILES => {}, |
48
|
|
|
|
|
|
|
BUILD_REQUIRES => { |
49
|
|
|
|
|
|
|
'ExtUtils::MakeMaker' => 0, |
50
|
|
|
|
|
|
|
}, |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
PREREQ_PM => { |
53
|
|
|
|
|
|
|
'Exporter' => 5, # for 'import' |
54
|
|
|
|
|
|
|
'POSIX' => 0, # for 'setsid' on POSIXish systems |
55
|
|
|
|
|
|
|
'Mojolicious' => 8, |
56
|
|
|
|
|
|
|
'Moo' => 2, # for some hashes-as-objects |
57
|
|
|
|
|
|
|
'Moo::Role' => 2, |
58
|
|
|
|
|
|
|
'Filter::signatures' => 0.16, |
59
|
|
|
|
|
|
|
'JSON' => 0, |
60
|
|
|
|
|
|
|
}, |
61
|
|
|
|
|
|
|
TEST_REQUIRES => { |
62
|
|
|
|
|
|
|
'Test::More' => 0, |
63
|
|
|
|
|
|
|
}, |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, |
66
|
|
|
|
|
|
|
clean => { FILES => "$distbase-*" }, |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
test => { TESTS => join( ' ', @tests ) }, |
69
|
|
|
|
|
|
|
); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
# This is so that we can do |
72
|
|
|
|
|
|
|
# require 'Makefile.PL' |
73
|
|
|
|
|
|
|
# and then call get_module_info |
74
|
|
|
|
|
|
|
|
75
|
1
|
|
|
1
|
|
9
|
sub get_module_info { %module } |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
if( ! caller ) { |
78
|
|
|
|
|
|
|
# I should maybe use something like Shipwright... |
79
|
|
|
|
|
|
|
regen_README($main_file); |
80
|
|
|
|
|
|
|
regen_EXAMPLES() if -d 'examples'; |
81
|
|
|
|
|
|
|
WriteMakefile1(get_module_info); |
82
|
|
|
|
|
|
|
}; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub WriteMakefile1 { #Written by Alexandr Ciornii, version 0.21. Added by eumm-upgrade. |
87
|
0
|
|
|
0
|
|
|
my %params=@_; |
88
|
0
|
|
|
|
|
|
my $eumm_version=$ExtUtils::MakeMaker::VERSION; |
89
|
0
|
|
|
|
|
|
$eumm_version=eval $eumm_version; |
90
|
0
|
0
|
|
|
|
|
die "EXTRA_META is deprecated" if exists $params{EXTRA_META}; |
91
|
0
|
0
|
|
|
|
|
die "License not specified" if not exists $params{LICENSE}; |
92
|
0
|
0
|
0
|
|
|
|
if ($params{BUILD_REQUIRES} and $eumm_version < 6.5503) { |
93
|
|
|
|
|
|
|
#EUMM 6.5502 has problems with BUILD_REQUIRES |
94
|
0
|
0
|
|
|
|
|
$params{PREREQ_PM}={ %{$params{PREREQ_PM} || {}} , %{$params{BUILD_REQUIRES}} }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
95
|
0
|
|
|
|
|
|
delete $params{BUILD_REQUIRES}; |
96
|
|
|
|
|
|
|
} |
97
|
0
|
0
|
0
|
|
|
|
if ($params{TEST_REQUIRES} and $eumm_version < 6.64) { |
98
|
0
|
0
|
|
|
|
|
$params{PREREQ_PM}={ %{$params{PREREQ_PM} || {}} , %{$params{TEST_REQUIRES}} }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
delete $params{TEST_REQUIRES}; |
100
|
|
|
|
|
|
|
} |
101
|
0
|
0
|
|
|
|
|
delete $params{CONFIGURE_REQUIRES} if $eumm_version < 6.52; |
102
|
0
|
0
|
|
|
|
|
delete $params{MIN_PERL_VERSION} if $eumm_version < 6.48; |
103
|
0
|
0
|
|
|
|
|
delete $params{META_MERGE} if $eumm_version < 6.46; |
104
|
0
|
0
|
|
|
|
|
delete $params{META_ADD} if $eumm_version < 6.46; |
105
|
0
|
0
|
|
|
|
|
delete $params{LICENSE} if $eumm_version < 6.31; |
106
|
0
|
0
|
|
|
|
|
delete $params{AUTHOR} if $] < 5.005; |
107
|
0
|
0
|
|
|
|
|
delete $params{ABSTRACT_FROM} if $] < 5.005; |
108
|
0
|
0
|
|
|
|
|
delete $params{BINARY_LOCATION} if $] < 5.005; |
109
|
|
|
|
|
|
|
|
110
|
0
|
|
|
|
|
|
WriteMakefile(%params); |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub regen_README { |
114
|
|
|
|
|
|
|
# README is the short version that just tells people what this is |
115
|
|
|
|
|
|
|
# and how to install it |
116
|
0
|
|
|
0
|
|
|
eval { |
117
|
|
|
|
|
|
|
# Get description |
118
|
0
|
|
|
|
|
|
my $readme = join "\n", |
119
|
|
|
|
|
|
|
pod_section($_[0], 'NAME', 'no heading' ), |
120
|
|
|
|
|
|
|
pod_section($_[0], 'DESCRIPTION' ), |
121
|
|
|
|
|
|
|
<
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
INSTALLATION |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
This is a Perl module distribution. It should be installed with whichever |
126
|
|
|
|
|
|
|
tool you use to manage your installation of Perl, e.g. any of |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
cpanm . |
129
|
|
|
|
|
|
|
cpan . |
130
|
|
|
|
|
|
|
cpanp -i . |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
Consult https://www.cpan.org/modules/INSTALL.html for further instruction. |
133
|
|
|
|
|
|
|
Should you wish to install this module manually, the procedure is |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
perl Makefile.PL |
136
|
|
|
|
|
|
|
make |
137
|
|
|
|
|
|
|
make test |
138
|
|
|
|
|
|
|
make install |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
INSTALL |
141
|
|
|
|
|
|
|
pod_section($_[0], 'REPOSITORY'), |
142
|
|
|
|
|
|
|
pod_section($_[0], 'SUPPORT'), |
143
|
|
|
|
|
|
|
pod_section($_[0], 'TALKS'), |
144
|
|
|
|
|
|
|
pod_section($_[0], 'KNOWN ISSUES'), |
145
|
|
|
|
|
|
|
pod_section($_[0], 'BUG TRACKER'), |
146
|
|
|
|
|
|
|
pod_section($_[0], 'CONTRIBUTING'), |
147
|
|
|
|
|
|
|
pod_section($_[0], 'SEE ALSO'), |
148
|
|
|
|
|
|
|
pod_section($_[0], 'AUTHOR'), |
149
|
|
|
|
|
|
|
pod_section($_[0], 'LICENSE' ), |
150
|
|
|
|
|
|
|
pod_section($_[0], 'COPYRIGHT' ), |
151
|
|
|
|
|
|
|
; |
152
|
0
|
|
|
|
|
|
update_file( 'README', $readme ); |
153
|
|
|
|
|
|
|
}; |
154
|
|
|
|
|
|
|
# README.mkdn is the documentation that will be shown as the main |
155
|
|
|
|
|
|
|
# page of the repository on Github. Hence we recreate the POD here |
156
|
|
|
|
|
|
|
# as Markdown |
157
|
0
|
|
|
|
|
|
eval { |
158
|
0
|
|
|
|
|
|
require Pod::Markdown; |
159
|
|
|
|
|
|
|
|
160
|
0
|
|
|
|
|
|
my $parser = Pod::Markdown->new(); |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
# Read POD from Module.pm and write to README |
163
|
0
|
|
|
|
|
|
$parser->parse_from_file($_[0]); |
164
|
0
|
|
|
|
|
|
my $readme_mkdn = <as_markdown; |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/Corion/$distlink?branch=master&svg=true)](https://ci.appveyor.com/project/Corion/$distlink) |
167
|
|
|
|
|
|
|
[![Windows](https://github.com/Corion/$distbase/workflows/windows/badge.svg)](https://github.com/Corion/$distbase/actions?query=workflow%3Awindows) |
168
|
|
|
|
|
|
|
[![MacOS](https://github.com/Corion/$distbase/workflows/macos/badge.svg)](https://github.com/Corion/$distbase/actions?query=workflow%3Amacos) |
169
|
|
|
|
|
|
|
[![Linux](https://github.com/Corion/$distbase/workflows/linux/badge.svg)](https://github.com/Corion/$distbase/actions?query=workflow%3Alinux) |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
STATUS |
172
|
0
|
|
|
|
|
|
update_file( 'README.mkdn', $readme_mkdn ); |
173
|
|
|
|
|
|
|
}; |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
sub pod_section { |
177
|
0
|
|
|
0
|
|
|
my( $filename, $section, $remove_heading ) = @_; |
178
|
0
|
0
|
|
|
|
|
open my $fh, '<', $filename |
179
|
|
|
|
|
|
|
or die "Couldn't read '$filename': $!"; |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
my @section = |
182
|
0
|
|
|
|
|
|
grep { /^=head1\s+$section/.../^=/ } <$fh>; |
|
0
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
# Trim the section |
185
|
0
|
0
|
|
|
|
|
if( @section ) { |
186
|
0
|
0
|
|
|
|
|
pop @section if $section[-1] =~ /^=/; |
187
|
0
|
0
|
|
|
|
|
shift @section if $remove_heading; |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
pop @section |
190
|
0
|
|
0
|
|
|
|
while @section and $section[-1] =~ /^\s*$/; |
191
|
|
|
|
|
|
|
shift @section |
192
|
0
|
|
0
|
|
|
|
while @section and $section[0] =~ /^\s*$/; |
193
|
|
|
|
|
|
|
}; |
194
|
|
|
|
|
|
|
|
195
|
0
|
|
|
|
|
|
@section = map { $_ =~ s!^=\w+\s+!!; $_ } @section; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
196
|
0
|
|
|
|
|
|
return join "", @section; |
197
|
|
|
|
|
|
|
} |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
sub regen_EXAMPLES { |
200
|
0
|
|
|
0
|
|
|
my $perl = $^X; |
201
|
0
|
0
|
|
|
|
|
if ($perl =~/\s/) { |
202
|
0
|
|
|
|
|
|
$perl = qq{"$perl"}; |
203
|
|
|
|
|
|
|
}; |
204
|
0
|
|
|
|
|
|
(my $example_file = $main_file) =~ s!\.pm$!/Examples.pm!; |
205
|
0
|
|
|
|
|
|
my $examples = `$perl -w examples/gen_examples_pod.pl`; |
206
|
0
|
0
|
|
|
|
|
if ($examples) { |
207
|
0
|
|
|
|
|
|
warn "(Re)Creating $example_file\n"; |
208
|
0
|
|
|
|
|
|
$examples =~ s/\r\n/\n/g; |
209
|
0
|
|
|
|
|
|
update_file( $example_file, $examples ); |
210
|
|
|
|
|
|
|
}; |
211
|
|
|
|
|
|
|
}; |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
sub update_file { |
214
|
0
|
|
|
0
|
|
|
my( $filename, $new_content ) = @_; |
215
|
0
|
|
|
|
|
|
my $content; |
216
|
0
|
0
|
|
|
|
|
if( -f $filename ) { |
217
|
0
|
0
|
|
|
|
|
open my $fh, '<', $filename |
218
|
|
|
|
|
|
|
or die "Couldn't read '$filename': $!"; |
219
|
0
|
|
|
|
|
|
binmode $fh; |
220
|
0
|
|
|
|
|
|
local $/; |
221
|
0
|
|
|
|
|
|
$content = <$fh>; |
222
|
|
|
|
|
|
|
}; |
223
|
|
|
|
|
|
|
|
224
|
0
|
0
|
|
|
|
|
if( $content ne $new_content ) { |
225
|
0
|
0
|
|
|
|
|
if( open my $fh, '>', $filename ) { |
226
|
0
|
|
|
|
|
|
binmode $fh; |
227
|
0
|
|
|
|
|
|
print $fh $new_content; |
228
|
|
|
|
|
|
|
} else { |
229
|
0
|
|
|
|
|
|
warn "Couldn't (re)write '$filename': $!"; |
230
|
|
|
|
|
|
|
}; |
231
|
|
|
|
|
|
|
}; |
232
|
|
|
|
|
|
|
} |