Pod/Weaver/PluginBundle/Author/RWSTAUNER.pm

filter: Statementstmt 37.5% 12 / 32 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 37.5% 3 / 8 Podpod 0.0% 0 / 1 totaltotal 31.2% 15 / 48 CC 4 SCAR 16.5
CC
4
Cov
32%
_bundle_name
12.0
mvp_bundle_config
6.0
_exp
2.0
CRAP 5.2
« Dist/Zilla/PluginBundle/Author/RWSTAUNER.pm ↑ Summary Dist/Zilla/PluginBundle/Author/RWSTAUNER/Minter.pm »
1 # vim: set ts=2 sts=2 sw=2 expandtab smarttab:
2 #
3 # This file is part of Dist-Zilla-PluginBundle-Author-RWSTAUNER
4 #
5 # This software is copyright (c) 2010 by Randy Stauner.
6 #
7 # This is free software; you can redistribute it and/or modify it under
8 # the same terms as the Perl 5 programming language system itself.
9 #
10 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 package Pod::Weaver::PluginBundle::Author::RWSTAUNER;
14 1 our $AUTHORITY = 'cpan:RWSTAUNER';
15 1 $Pod::Weaver::PluginBundle::Author::RWSTAUNER::VERSION = '6.002';
16 # ABSTRACT: RWSTAUNER's Pod::Weaver config
17  
18 1 ▶use Pod::Weaver::Config::Assembler;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 0 ▶sub _exp { Pod::Weaver::Config::Assembler->expand_package($_[0]) }
Subroutine _exp: not called CC=1 SCAR=6.9
20  
21 0 ▶sub _plain {
Subroutine _plain: not called CC=1 SCAR=6.9
22 0 my ($plug, $arg) = (@_, {});
23 0 (my $name = $plug) =~ s/^\W//;
24 0 return [ $name, _exp($plug), { %$arg } ];
25 }
26  
27 0 ▶sub _bundle_name {
Subroutine _bundle_name: not called CC=3 SCAR=24.8
28 0 ▶ my $class = @_ ? ref $_[0] || $_[0] : __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
Condition0%0/3
ref $_[0] or $_[0]
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $_[0] or $_[0]
ref $_[0] $_[0]
Truth table0%0/3
A or B
A= ref $_[0]B= $_[0]
ABresult
1X1
011
000
29 0 join('', '@', ($class =~ /^.+::PluginBundle::(.+)$/));
30 }
31  
32 0 ▶sub _for {
Subroutine _for: not called CC=1 SCAR=6.9
33 0 my ($region) = @_;
34 0 [ $region, _exp('Region'), { region_name => $region, allow_nonpod => 1, flatten => 0 } ],
35 }
36  
37 0 ▶sub mvp_bundle_config {
Subroutine mvp_bundle_config: not called CC=2 SCAR=17.9
Pod undocumented
38 ## ($self, $bundle) = @_; $bundle => {payload => {}, name => '@...'}
39 0 my ($self) = @_;
40 0 my @plugins;
41  
42 # NOTE: bundle name gets prepended to each plugin name at the end
43  
44 0 push @plugins, (
45 # plugin
46 _plain('-SingleEncoding'),
47 _plain('-WikiDoc'),
48 # default
49 _plain('@CorePrep'),
50  
51 # sections
52 # default
53 _plain('Name'),
54 _plain('Version'),
55  
56 # Any pod inside a =begin/end :prelude will go at the top
57 [ 'Prelude', _exp('Region'), { region_name => 'prelude' } ],
58  
59 # Before Synopsis.
60 _for('test_synopsis'),
61 );
62  
63 0 for my $plugin (
64  
65 # default
66 [ 'Synopsis', _exp('Generic'), {} ],
67 [ 'Description', _exp('Generic'), {} ],
68 [ 'Overview', _exp('Generic'), {} ],
69 # extra
70 [ 'Usage', _exp('Generic'), {} ],
71  
72 ['Class Methods',_exp('Collect'), { command => 'class_method' } ], # header => 'CLASS METHODS',
73 # default
74 [ 'Attributes', _exp('Collect'), { command => 'attr' } ],
75 [ 'Methods', _exp('Collect'), { command => 'method' } ],
76 [ 'Functions', _exp('Collect'), { command => 'func' } ],
77 ) {
78 0 $plugin->[2]{header} = uc $plugin->[0];
79 0 push @plugins, $plugin;
80 }
81  
82 # default
83 0 push @plugins, (
84 _plain('Leftovers'),
85 # see prelude above
86 [ 'Postlude', _exp('Region'), { region_name => 'postlude' } ],
87  
88 # TODO: consider SeeAlso if it ever allows comments with the links
89  
90 # extra
91 # include Support section with various cpan links and github repo
92 [ 'Support', _exp('Support'),
93 {
94 ':version' => '1.005', # metacpan
95 repository_content => '',
96 repository_link => 'both',
97 # metacpan links to everything else
98 websites => [ qw(metacpan) ],
99 }
100 ],
101  
102 [ 'Acknowledgements', _exp('Generic'), {header => 'ACKNOWLEDGEMENTS'} ],
103  
104 _plain('Authors'),
105 _plain('Contributors'),
106  
107 _plain('Legal'),
108  
109 # plugins
110 [ 'List', _exp('-Transformer'), { 'transformer' => 'List' } ],
111  
112 _plain('-StopWords', {
113 ':version' => '1.005', # after =encoding
114 # my dictionary doesn't like that extra 'E' but it looks funny without it
115 include => 'ACKNOWLEDGEMENTS'
116 }),
117 );
118  
119 # prepend bundle name to each plugin name
120 0 my $name = $self->_bundle_name;
121 0 @plugins = map { $_->[0] = "$name/$_->[0]"; $_ } @plugins;
122  
123 0 return @plugins;
124 }
125  
126 1 1;
127  
128 __END__
« Dist/Zilla/PluginBundle/Author/RWSTAUNER.pm ↑ Summary Dist/Zilla/PluginBundle/Author/RWSTAUNER/Minter.pm »