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