blib/lib/Dist/Zilla/Plugin/Test/Kwalitee/Extra.pm

filter: Statementstmt 97.0% 33 / 34 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 100% 2 / 2 totaltotal 93.4% 43 / 46 CC 3 SCAR 4.8
CC
3
Cov
94%
gather_files
3.0
__ANON__
1.1
BEGIN
1.0
CRAP 1.6
↑ Summary
1 package Dist::Zilla::Plugin::Test::Kwalitee::Extra;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # ABSTRACT: Dist::Zilla plugin for Test::Kwalitee::Extra
7 2 our $VERSION = 'v0.2.1'; # VERSION
8  
9 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Data::Section-setup;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 with 'Dist::Zilla::Role::FileGatherer', 'Dist::Zilla::Role::TextTemplate';
12  
13 1 ▶sub mvp_multivalue_args { return qw( arg ) }
Subroutine mvp_multivalue_args: called CC=1 SCAR=0.0
Pod documented
14  
15 0 ▶has arg => ( is => 'ro', isa => 'ArrayRef[Str]', traits => [ 'Array' ], default => sub { [] }, handles => { push_arg => 'push' }, );
Subroutine __ANON__: not called CC=1 SCAR=1.2
16  
17 1 ▶sub gather_files {
Subroutine gather_files: called CC=3 SCAR=11.0
Pod documented
18 1 my ( $self, ) = @_;
19  
20 1 my $tests = q{eval "use Test::Kwalitee::Extra";};
21  
22 1 ▶ if ( @{ $self->arg } > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@{$self->arg;} > 0) 1 0 1
23  
24 1 my $arg = join ' ', @{ $self->arg };
25 1 $tests = qq[eval "use Test::Kwalitee::Extra qw( $arg )"];
26  
27 }
28 1 require Dist::Zilla::File::InMemory;
29  
30 1 for my $filename ( qw( xt/release/kwalitee.t ) ) {
31 1 my $content = $self->fill_in_string( ${ $self->section_data( $filename ) }, { tests => \$tests }, );
32 1 $self->add_file( Dist::Zilla::File::InMemory->new( { 'name' => $filename, 'content' => $content, } ), );
33 }
34 } ## end sub gather_files
35  
36 2 __PACKAGE__->meta->make_immutable;
37 2 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
38 2 1;
39  
40 =pod
41  
42 =head1 NAME
43  
44 Dist::Zilla::Plugin::Test::Kwalitee::Extra - Dist::Zilla plugin for Test::Kwalitee::Extra
45  
46 =head1 VERSION
47  
48 version v0.2.1
49  
50 =head1 SYNOPSIS
51  
52 In your C<dist.ini>,
53  
54 [Test::Kwalitee::Extra]
55 arg = !has_example
56  
57 If you want to avoid network access
58  
59 [Test::Kwalitee::Extra]
60 arg = !prereq_matches_use
61  
62 =head1 DESCRIPTION
63  
64 This module is a L<Dist::Zilla> plugin for L<Test::Kwalitee::Extra>. It creates C<xt/release/kwalitee.t> to call L<Test::Kwalitee::Extra>.
65  
66 Most part of codes and tests are identical to L<Dist::Zilla::Plugin::Test::Kwalitee>. Only the followings are changed points.
67  
68 =over 4
69  
70 =item *
71  
72 Use L<Test::Kwalitee::Extra> instead of L<Test::Kwalitee>.
73  
74 =item *
75  
76 Change variable and configuration names.
77  
78 =item *
79  
80 Arguments are passed to Test::Kwalitee::Extra as it is. L<Dist::Zilla::Plugin::Test::Kwalitee> adds prefix C<-> to disable tests.
81  
82 =item *
83  
84 Test for more indicators.
85  
86 =back
87  
88 =head1 OPTIONS
89  
90 =over 4
91  
92 =item C<arg>
93  
94 They are passed through to L<Test::Kwalitee::Extra>.
95  
96 =back
97  
98 =head1 METHODS
99  
100 The following methods are overridden.
101  
102 =over 4
103  
104 =item C<mvp_multivalue_args>
105  
106 Declare C<arg>.
107  
108 =item C<gather_files>
109  
110 Create C<xt/release/kwalitee.t>.
111  
112 =back
113  
114 =head1 NAME
115  
116 Dist::Zilla::Plugin::Test::Kwalitee::Extra - Dist::Zilla plugin for Test::Kwalitee::Extra
117  
118 =head1 CAVEATS
119  
120 An optional indicator C<prereq_matches_use> and an experimental indicator C<build_prereq_matches_use> require HTTP access to L<MetaCPAN site|https://metacpan.org/>. If you want to avoid it, you can specify excluded indicators like
121  
122 # Avoid network access
123 [Test::Kwalitee::Extra]
124 arg = !prereq_matches_use
125  
126 # or, when experimental enabled
127 [Test::Kwalitee::Extra]
128 arg = :experimental !prereq_matches_use !build_prereq_matches_use
129  
130 Or mitigate wait by tentative failures to reduce retry counts like
131  
132 # Try just one time for each query
133 [Test::Kwalitee::Extra]
134 arg = :retry 1
135  
136 =head1 AUTHORS
137  
138 =over 4
139  
140 =item *
141  
142 L<Dist::Zilla::Plugin::Test::Kwalitee> authors
143  
144 =item *
145  
146 Yasutaka ATARASHI <yakex@cpan.org>
147  
148 =back
149  
150 =head1 LICENSE
151  
152 This is free software; you can redistribute it and/or modify it under
153 the same terms as the Perl 5 programming language system itself.
154  
155 =head1 AUTHOR
156  
157 Yasutaka ATARASHI <yakex@cpan.org>
158  
159 =head1 COPYRIGHT AND LICENSE
160  
161 This software is copyright (c) 2012 by Yasutaka ATARASHI.
162  
163 This is free software; you can redistribute it and/or modify it under
164 the same terms as the Perl 5 programming language system itself.
165  
166 =cut
167  
168 __DATA__
↑ Summary