line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package My::Builder; |
2
|
32
|
|
|
32
|
|
1267397
|
use Module::Build; |
|
32
|
|
|
|
|
286
|
|
|
32
|
|
|
|
|
3359
|
|
3
|
|
|
|
|
|
|
@ISA = qw(Module::Build); |
4
|
|
|
|
|
|
|
|
5
|
32
|
|
|
32
|
|
406
|
use File::Find; |
|
32
|
|
|
|
|
205
|
|
|
32
|
|
|
|
|
27125
|
|
6
|
|
|
|
|
|
|
my $have_p2m = eval "require Pod::Markdown; 1"; |
7
|
|
|
|
|
|
|
sub ACTION_author_tasks { |
8
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
9
|
0
|
|
|
|
|
|
my ($action, $subaction) = @ARGV; |
10
|
0
|
0
|
0
|
|
|
|
if ($subaction && ($subaction eq 'readme')) { |
11
|
0
|
0
|
|
|
|
|
unless ($have_p2m) { |
12
|
0
|
|
|
|
|
|
print "Don't have Pod::Markdown\n"; |
13
|
0
|
|
|
|
|
|
return; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
# write POD as .md in relevant lib/ subdirs |
16
|
|
|
|
|
|
|
find ( |
17
|
|
|
|
|
|
|
sub { |
18
|
0
|
0
|
|
0
|
|
|
return unless $_ =~ /^(.*)\.pm$/; |
19
|
0
|
|
|
|
|
|
my ($name) = $1; |
20
|
0
|
0
|
|
|
|
|
die unless defined $name; |
21
|
0
|
|
|
|
|
|
my $mdstr = ''; |
22
|
0
|
|
|
|
|
|
my $p2m = Pod::Markdown->new(); |
23
|
0
|
|
|
|
|
|
$p2m->local_module_url_prefix('github::'); |
24
|
0
|
|
|
|
|
|
$p2m->local_module_re(qr/^REST::Neo4p/); |
25
|
0
|
|
|
|
|
|
$p2m->output_string(\$mdstr); |
26
|
0
|
|
|
|
|
|
$p2m->parse_file($_); |
27
|
0
|
|
|
|
|
|
$mdstr =~ s/%3A%3A/::/g; |
28
|
0
|
|
|
|
|
|
$mdstr =~ s{(\][(]github::[^)]*[)])} |
29
|
0
|
|
|
|
|
|
{ |
30
|
0
|
|
|
|
|
|
$_ = $1; |
31
|
0
|
|
|
|
|
|
s|github::|/lib/|; |
32
|
0
|
|
|
|
|
|
s|::|/|g; |
33
|
0
|
|
|
|
|
|
s|[)]$|.md)|; |
34
|
|
|
|
|
|
|
$_ |
35
|
0
|
0
|
|
|
|
|
}eg; |
36
|
0
|
0
|
|
|
|
|
if (length $mdstr > 1) { |
37
|
0
|
|
|
|
|
|
open my $mdf, '>', "$name.md" or die $!; |
38
|
0
|
|
|
|
|
|
print $mdf $mdstr; |
39
|
|
|
|
|
|
|
close $mdf; |
40
|
|
|
|
|
|
|
} |
41
|
0
|
|
|
|
|
|
}, |
42
|
|
|
|
|
|
|
File::Spec->catdir($self->base_dir,'lib') |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
} |
46
|
0
|
|
|
|
|
|
else { |
47
|
0
|
|
|
|
|
|
print STDERR "Valid author tasks are:\n\treadme\n"; |
48
|
|
|
|
|
|
|
exit 1; |
49
|
|
|
|
|
|
|
} |
50
|
0
|
0
|
|
|
|
|
# use the dist-version-from .pm's .md as README.md |
51
|
0
|
|
|
|
|
|
if ($self->dist_version_from) { |
52
|
0
|
|
|
|
|
|
my $mdf = $self->dist_version_from; |
53
|
0
|
|
|
|
|
|
$mdf =~ s/\.pm/\.md/; |
54
|
|
|
|
|
|
|
$self->copy_if_modified( from => $mdf, to => 'README.md' ); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |