line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
721258
|
use 5.10.1; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
58
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Dist::Zilla::Plugin::Test::EOF; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
6
|
1
|
|
|
1
|
|
3
|
use Moose; |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
6
|
|
7
|
1
|
|
|
1
|
|
5708
|
use Sub::Exporter::ForMethods 'method_installer'; |
|
1
|
|
|
|
|
664
|
|
|
1
|
|
|
|
|
6
|
|
8
|
1
|
|
|
1
|
|
172
|
use Data::Section { installer => method_installer }, '-setup'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
9
|
1
|
|
|
1
|
|
664
|
use namespace::autoclean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.0501'; # VERSION |
12
|
|
|
|
|
|
|
# ABSTRACT: Check that all files in the projects end correctly |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
with 'Dist::Zilla::Role::FileGatherer', |
15
|
|
|
|
|
|
|
'Dist::Zilla::Role::TextTemplate', |
16
|
|
|
|
|
|
|
'Dist::Zilla::Role::PrereqSource', |
17
|
|
|
|
|
|
|
; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has minimum_newlines => ( |
20
|
|
|
|
|
|
|
is => 'ro', |
21
|
|
|
|
|
|
|
isa => 'Int', |
22
|
|
|
|
|
|
|
default => 1, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
has maximum_newlines => ( |
25
|
|
|
|
|
|
|
is => 'ro', |
26
|
|
|
|
|
|
|
isa => 'Int', |
27
|
|
|
|
|
|
|
lazy => 1, |
28
|
|
|
|
|
|
|
default => sub { shift->minimum_newlines + 3 }, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
has strict => ( |
31
|
|
|
|
|
|
|
is => 'ro', |
32
|
|
|
|
|
|
|
isa => 'Bool', |
33
|
|
|
|
|
|
|
default => 0, |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
has filename => ( |
36
|
|
|
|
|
|
|
is => 'ro', |
37
|
|
|
|
|
|
|
isa => 'Str', |
38
|
|
|
|
|
|
|
lazy => 1, |
39
|
|
|
|
|
|
|
default => 'xt/author/eof.t', |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
around dump_config => sub { |
44
|
|
|
|
|
|
|
my($orig, $self) = @_; |
45
|
|
|
|
|
|
|
my $config = $self->$orig; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
$config->{+__PACKAGE__} = { |
48
|
|
|
|
|
|
|
filename => $self->filename, |
49
|
|
|
|
|
|
|
}; |
50
|
|
|
|
|
|
|
return $config; |
51
|
|
|
|
|
|
|
}; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub gather_files { |
54
|
1
|
|
|
1
|
0
|
55738
|
my $self = shift; |
55
|
|
|
|
|
|
|
|
56
|
1
|
|
|
|
|
562
|
require Dist::Zilla::File::InMemory; |
57
|
|
|
|
|
|
|
|
58
|
1
|
|
|
|
|
6
|
$self->add_file( |
59
|
|
|
|
|
|
|
Dist::Zilla::File::InMemory->new( |
60
|
|
|
|
|
|
|
name => $self->filename, |
61
|
|
|
|
|
|
|
content => $self->fill_in_string( |
62
|
1
|
50
|
50
|
|
|
73164
|
${ $self->section_data('__TEST__') }, |
|
|
50
|
|
|
|
|
|
63
|
|
|
|
|
|
|
{ |
64
|
|
|
|
|
|
|
name => __PACKAGE__, |
65
|
|
|
|
|
|
|
version => __PACKAGE__->VERSION || 'boostraped_version', |
66
|
|
|
|
|
|
|
minimum_newlines => ($self->strict ? \1 : \$self->minimum_newlines), |
67
|
|
|
|
|
|
|
maximum_newlines => ($self->strict ? \1 : \$self->maximum_newlines), |
68
|
|
|
|
|
|
|
}, |
69
|
|
|
|
|
|
|
), |
70
|
|
|
|
|
|
|
), |
71
|
|
|
|
|
|
|
); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub register_prereqs { |
75
|
1
|
|
|
1
|
0
|
3728
|
my $self = shift; |
76
|
1
|
|
|
|
|
26
|
$self->zilla->register_prereqs( |
77
|
|
|
|
|
|
|
{ |
78
|
|
|
|
|
|
|
type => 'requires', |
79
|
|
|
|
|
|
|
phase => 'develop', |
80
|
|
|
|
|
|
|
}, |
81
|
|
|
|
|
|
|
'Test::More' => 0, |
82
|
|
|
|
|
|
|
'Test::EOF' => 0, |
83
|
|
|
|
|
|
|
); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=pod |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=encoding utf-8 |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 NAME |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Dist::Zilla::Plugin::Test::EOF - Check that all files in the projects end correctly |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 VERSION |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Version 0.0501, released 2015-02-04. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 SYNOPSIS |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
[Test::EOF] |
105
|
|
|
|
|
|
|
strict = 1 |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 DESCRIPTION |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Generates author tests using L<Test::EOF>. It checks that all Perl files end with the requested amount of new lines. It assumes that all linebreaks only consist of C<\n>. It does not check |
110
|
|
|
|
|
|
|
for any other line break character - use L<Dist::Zilla::Plugin::Test::EOL> for that. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head2 ATTRIBUTES |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
The following attributes are accepted: |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
B<C<minimum_newlines>> |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Default: C<1> |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
The lowest amount of newlines acceptable at end-of-file. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
B<C<maximum_newlines>> |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Default: C<minimum_newlines + 3> |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
The highest amount of newlines acceptable at end-of-file. |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
B<C<strict>> |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Default: C<0> |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
If true, sets both C<minimum_newlines> and C<maximum_newlines> to C<1>. This option has precedence. |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 SEE ALSO |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
L<Dist::Zilla::Plugin::Test::EOL> |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head1 SOURCE |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
L<https://github.com/Csson/p5-dist-zilla-plugin-test-eof> |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=head1 HOMEPAGE |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
L<https://metacpan.org/release/Dist-Zilla-Plugin-Test-EOF> |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head1 AUTHOR |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
Erik Carlsson <info@code301.com> |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Erik Carlsson <info@code301.com>. |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
155
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=cut |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
__DATA__ |
160
|
|
|
|
|
|
|
___[ __TEST__ ]___ |
161
|
|
|
|
|
|
|
use strict; |
162
|
|
|
|
|
|
|
use warnings; |
163
|
|
|
|
|
|
|
use Test::More; |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
# Generated by {{ $name }} {{ $version }} |
166
|
|
|
|
|
|
|
eval "use Test::EOF"; |
167
|
|
|
|
|
|
|
plan skip_all => 'Test::EOF required to test for correct end of file flag' if $@; |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
all_perl_files_ok({ minimum_newlines => {{ $minimum_newlines }}, maximum_newlines => {{ $maximum_newlines }} }); |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
done_testing(); |