line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
1708
|
use 5.10.0; |
|
2
|
|
|
|
|
7
|
|
2
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
57
|
|
3
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
179
|
|
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.1409'; |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
15
|
use Dist::Iller::Elk; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
24
|
|
12
|
|
|
|
|
|
|
with qw/ |
13
|
|
|
|
|
|
|
Dist::Iller::DocType |
14
|
|
|
|
|
|
|
Dist::Iller::Role::HasPlugins |
15
|
|
|
|
|
|
|
/; |
16
|
|
|
|
|
|
|
|
17
|
6
|
|
|
6
|
0
|
88
|
sub filename { 'weaver.ini' } |
18
|
|
|
|
|
|
|
|
19
|
9
|
|
|
9
|
0
|
52
|
sub phase { 'before' } |
20
|
|
|
|
|
|
|
|
21
|
6
|
|
|
6
|
0
|
33
|
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
|
3
|
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
|
|
95
|
my $plugin = shift; |
51
|
|
|
|
|
|
|
|
52
|
62
|
|
|
|
|
118
|
my $packages = []; |
53
|
|
|
|
|
|
|
# For -Transformer |
54
|
62
|
100
|
|
|
|
1749
|
if($plugin->has_base) { |
55
|
34
|
100
|
|
|
|
831
|
if($plugin->in eq 'Elemental') { |
56
|
2
|
|
|
|
|
51
|
my $base = $plugin->base; |
57
|
2
|
|
|
|
|
11
|
$base =~ s{^[^a-zA-Z]}{}; |
58
|
|
|
|
|
|
|
|
59
|
2
|
|
|
|
|
8
|
push @{ $packages } => { version => $plugin->version, package => sprintf 'Pod::Elemental::%s::%s', $base, $plugin->plugin_name }; |
|
2
|
|
|
|
|
53
|
|
60
|
2
|
|
|
|
|
6
|
push @{ $packages } => { version => 0, package => "Pod::Weaver::Plugin::$base" }; |
|
2
|
|
|
|
|
11
|
|
61
|
2
|
|
|
|
|
9
|
return $packages; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
60
|
100
|
|
|
|
1670
|
my $name = $plugin->has_base ? $plugin->base : $plugin->plugin_name; |
65
|
60
|
|
|
|
|
172
|
$name =~ m{^(.)}; |
66
|
60
|
|
|
|
|
112
|
my $first = $1; |
67
|
|
|
|
|
|
|
|
68
|
60
|
|
|
|
|
113
|
my $clean_name = $name; |
69
|
60
|
|
|
|
|
150
|
$clean_name =~ s{^[-%=@]}{}; |
70
|
|
|
|
|
|
|
|
71
|
60
|
50
|
|
|
|
441
|
push @{ $packages } => $first eq '-' ? { version => $plugin->version, package => sprintf 'Pod::Weaver::Plugin::%s', $clean_name } |
|
60
|
100
|
|
|
|
1788
|
|
|
|
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
|
|
|
|
|
188
|
return $packages; |
77
|
4
|
|
|
4
|
0
|
249
|
}; |
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.1409, released 2020-12-27. |
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) 2016 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 |