line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
1477
|
use 5.14.0; |
|
2
|
|
|
|
|
8
|
|
2
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
52
|
|
3
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
143
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Dist::Iller::DocType::Weaver; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY |
8
|
|
|
|
|
|
|
# ABSTRACT: Turn the Dist::Iller config into a weaver.ini file |
9
|
|
|
|
|
|
|
our $VERSION = '0.1411'; |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
15
|
use Dist::Iller::Elk; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
21
|
|
12
|
|
|
|
|
|
|
with qw/ |
13
|
|
|
|
|
|
|
Dist::Iller::DocType |
14
|
|
|
|
|
|
|
Dist::Iller::Role::HasPlugins |
15
|
|
|
|
|
|
|
/; |
16
|
|
|
|
|
|
|
|
17
|
6
|
|
|
6
|
0
|
104
|
sub filename { 'weaver.ini' } |
18
|
|
|
|
|
|
|
|
19
|
9
|
|
|
9
|
0
|
66
|
sub phase { 'before' } |
20
|
|
|
|
|
|
|
|
21
|
6
|
|
|
6
|
0
|
44
|
sub comment_start { ';' } |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub parse { |
24
|
|
|
|
|
|
|
my $self = shift; |
25
|
|
|
|
|
|
|
my $yaml = shift; |
26
|
|
|
|
|
|
|
$self->parse_plugins($yaml->{'plugins'}); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub to_hash { |
30
|
1
|
|
|
1
|
0
|
5
|
my $self = shift; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
return { |
33
|
1
|
|
|
|
|
6
|
plugins => $self->plugins_to_hash, |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub to_string { |
38
|
|
|
|
|
|
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
my @strings = (); |
41
|
|
|
|
|
|
|
foreach my $plugin ($self->all_plugins) { |
42
|
|
|
|
|
|
|
push @strings => $plugin->to_string, ''; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
return join "\n" => @strings; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub packages_for_plugin { |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
return sub { |
50
|
62
|
|
|
62
|
|
101
|
my $plugin = shift; |
51
|
|
|
|
|
|
|
|
52
|
62
|
|
|
|
|
108
|
my $packages = []; |
53
|
|
|
|
|
|
|
# For -Transformer |
54
|
62
|
100
|
|
|
|
1735
|
if($plugin->has_base) { |
55
|
34
|
100
|
|
|
|
868
|
if($plugin->in eq 'Elemental') { |
56
|
2
|
|
|
|
|
51
|
my $base = $plugin->base; |
57
|
2
|
|
|
|
|
12
|
$base =~ s{^[^a-zA-Z]}{}; |
58
|
|
|
|
|
|
|
|
59
|
2
|
|
|
|
|
6
|
push @{ $packages } => { version => $plugin->version, package => sprintf 'Pod::Elemental::%s::%s', $base, $plugin->plugin_name }; |
|
2
|
|
|
|
|
55
|
|
60
|
2
|
|
|
|
|
16
|
push @{ $packages } => { version => 0, package => "Pod::Weaver::Plugin::$base" }; |
|
2
|
|
|
|
|
14
|
|
61
|
2
|
|
|
|
|
12
|
return $packages; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
60
|
100
|
|
|
|
1711
|
my $name = $plugin->has_base ? $plugin->base : $plugin->plugin_name; |
65
|
60
|
|
|
|
|
148
|
$name =~ m{^(.)}; |
66
|
60
|
|
|
|
|
117
|
my $first = $1; |
67
|
|
|
|
|
|
|
|
68
|
60
|
|
|
|
|
103
|
my $clean_name = $name; |
69
|
60
|
|
|
|
|
141
|
$clean_name =~ s{^[-%=@]}{}; |
70
|
|
|
|
|
|
|
|
71
|
60
|
50
|
|
|
|
84
|
push @{ $packages } => $first eq '-' ? { version => $plugin->version, package => sprintf 'Pod::Weaver::Plugin::%s', $clean_name } |
|
60
|
100
|
|
|
|
1702
|
|
|
|
100
|
|
|
|
|
|
72
|
|
|
|
|
|
|
: $first eq '@' ? { version => $plugin->version, package => sprintf 'Pod::Weaver::PluginBundle::%s', $clean_name } |
73
|
|
|
|
|
|
|
: $first eq '=' ? { version => $plugin->version, package => sprintf $clean_name } |
74
|
|
|
|
|
|
|
: { version => $plugin->version, package => sprintf 'Pod::Weaver::Section::%s', $clean_name } |
75
|
|
|
|
|
|
|
; |
76
|
60
|
|
|
|
|
169
|
return $packages; |
77
|
4
|
|
|
4
|
0
|
224
|
}; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
__END__ |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=pod |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=encoding UTF-8 |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 NAME |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Dist::Iller::DocType::Weaver - Turn the Dist::Iller config into a weaver.ini file |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 VERSION |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Version 0.1411, released 2020-01-01. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 SOURCE |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
L<https://github.com/Csson/p5-Dist-Iller> |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 HOMEPAGE |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
L<https://metacpan.org/release/Dist-Iller> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 AUTHOR |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Erik Carlsson <info@code301.com> |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
This software is copyright (c) 2021 by Erik Carlsson. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
115
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=cut |