]> Dogcows Code - chaz/p5-Dist-Zilla-PluginBundle-Author-CCM/blob - lib/Pod/Weaver/PluginBundle/Author/CCM.pm
Version 0.011
[chaz/p5-Dist-Zilla-PluginBundle-Author-CCM] / lib / Pod / Weaver / PluginBundle / Author / CCM.pm
1 package Pod::Weaver::PluginBundle::Author::CCM;
2 # ABSTRACT: A plugin bundle for pod woven by CCM
3
4
5 use 5.008;
6 use warnings;
7 use strict;
8
9 our $VERSION = '0.011'; # VERSION
10
11 use Pod::Weaver::Config::Assembler;
12 use namespace::autoclean;
13
14
15 sub configure {
16 return (
17 ['-EnsurePod5'],
18 ['-H1Nester'],
19 ['-SingleEncoding'],
20
21 ['-Transformer' => List => {transformer => 'List'}],
22 ['-Transformer' => Verbatim => {transformer => 'Verbatim'}],
23
24 ['Region' => 'header'],
25
26 'Name',
27 # ['Badges' => {badge => [qw(perl travis coverage)], formats => 'html, markdown'}],
28
29 'Version',
30
31 ['Region' => 'prelude'],
32
33 ['Generic' => 'SYNOPSIS'],
34 ['Generic' => 'DESCRIPTION'],
35 ['Generic' => 'OVERVIEW'],
36 ['Collect' => 'ATTRIBUTES' => {command => 'attr'}],
37 ['Collect' => 'METHODS' => {command => 'method'}],
38 ['Collect' => 'FUNCTIONS' => {command => 'func'}],
39
40 'Leftovers',
41
42 ['Region' => 'postlude'],
43
44 'Bugs',
45 'Authors',
46 'Contributors',
47 'Legal',
48
49 ['Region' => 'footer'],
50 );
51 }
52
53
54 sub mvp_bundle_config {
55 my $self = shift || __PACKAGE__;
56
57 return map { $self->_expand_config($_) } $self->configure;
58 }
59
60 sub _exp { Pod::Weaver::Config::Assembler->expand_package($_[0]) }
61
62 sub _expand_config {
63 my $self = shift;
64 my $spec = shift;
65
66 my ($name, $package, $payload);
67
68 if (!ref $spec) {
69 ($name, $package, $payload) = ($spec, $spec, {});
70 }
71 elsif (@$spec == 1) {
72 ($name, $package, $payload) = (@$spec[0,0], {});
73 }
74 elsif (@$spec == 2) {
75 ($name, $package, $payload) = ref $spec->[1] ? @$spec[0,0,1] : (@$spec[1,0], {});
76 }
77 else {
78 ($package, $name, $payload) = @$spec;
79 }
80
81 $name =~ s/^[@=-]//;
82 $package = _exp($package);
83
84 if ($package eq _exp('Region')) {
85 $name = $spec->[1];
86 $payload = {region_name => $spec->[1], %$payload};
87 }
88
89 $name = '@Author::CCM/' . $name if $package ne _exp('Generic') && $package ne _exp('Collect');
90
91 return [$name => $package => $payload];
92 }
93
94 1;
95
96 __END__
97
98 =pod
99
100 =encoding UTF-8
101
102 =head1 NAME
103
104 Pod::Weaver::PluginBundle::Author::CCM - A plugin bundle for pod woven by CCM
105
106 =head1 VERSION
107
108 version 0.011
109
110 =head1 SYNOPSIS
111
112 # In your weaver.ini file:
113 [@Author::CCM]
114
115 # In your dist.ini file:
116 [PodWeaver]
117 config_plugin = @Author::CCM
118
119 =head1 DESCRIPTION
120
121 You probably don't want to use this.
122
123 =head1 METHODS
124
125 =head2 configure
126
127 Returns the configuration in a form similar to what one might use with
128 L<Dist::Zilla::Role::PluginBundle::Easy/add_plugins>.
129
130 =head2 mvp_bundle_config
131
132 Required in order to be a plugin bundle.
133
134 =head1 SEE ALSO
135
136 =over 4
137
138 =item *
139
140 L<Pod::Weaver>
141
142 =item *
143
144 L<Pod::Weaver::PluginBundle::Author::ETHER>
145
146 =back
147
148 =head1 CREDITS
149
150 This module was heavily inspired by Karen Etheridge's config.
151
152 =head1 BUGS
153
154 Please report any bugs or feature requests on the bugtracker website
155 L<https://github.com/chazmcgarvey/Dist-Zilla-PluginBundle-Author-CCM/issues>
156
157 When submitting a bug or request, please include a test-file or a
158 patch to an existing test-file that illustrates the bug or desired
159 feature.
160
161 =head1 AUTHOR
162
163 Charles McGarvey <ccm@cpan.org>
164
165 =head1 COPYRIGHT AND LICENSE
166
167 This software is copyright (c) 2016 by Charles McGarvey.
168
169 This is free software; you can redistribute it and/or modify it under
170 the same terms as the Perl 5 programming language system itself.
171
172 =cut
This page took 0.044541 seconds and 4 git commands to generate.