File Coverage

blib/lib/Dist/Zilla/Plugin/Manifest/Read.pm
Criterion Covered Total %
statement 124 127 97.6
branch 22 24 91.6
condition 10 16 62.5
subroutine 21 21 100.0
pod 3 3 100.0
total 180 191 94.2


line stmt bran cond sub pod time code
1             # ---------------------------------------------------------------------- copyright and license ---
2             #
3             # file: lib/Dist/Zilla/Plugin/Manifest/Read.pm
4             #
5             # Copyright © 2015, 2016 Van de Bugger.
6             #
7             # This file is part of perl-Dist-Zilla-Plugin-Manifest-Read.
8             #
9             # perl-Dist-Zilla-Plugin-Manifest-Read is free software: you can redistribute it and/or modify it
10             # under the terms of the GNU General Public License as published by the Free Software Foundation,
11             # either version 3 of the License, or (at your option) any later version.
12             #
13             # perl-Dist-Zilla-Plugin-Manifest-Read is distributed in the hope that it will be useful, but
14             # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15             # PARTICULAR PURPOSE. See the GNU General Public License for more details.
16             #
17             # You should have received a copy of the GNU General Public License along with
18             # perl-Dist-Zilla-Plugin-Manifest-Read. If not, see <http://www.gnu.org/licenses/>.
19             #
20             # ---------------------------------------------------------------------- copyright and license ---
21              
22             #pod =for :this This is C<Dist::Zilla::Plugin::Manifest::Read> module documentation. Read this if you are going to hack or
23             #pod extend C<Manifest::Read>, or use it programmatically.
24             #pod
25             #pod =for :those If you want to have annotated source manifest, read the L<user manual|Dist::Zilla::Plugin::Manifest::Read::Manual>.
26             #pod General topics like getting source, building, installing, bug reporting and some others are covered
27             #pod in the F<README>.
28             #pod
29             #pod =for test_synopsis my $self;
30             #pod
31             #pod =head1 SYNOPSIS
32             #pod
33             #pod In your plugin:
34             #pod
35             #pod # Iterate through the distribution files listed in MANIFEST:
36             #pod my $finder = $self->zilla->plugin_named( 'Manifest::Read/:AllFiles' );
37             #pod for my $file ( @{ $finder->find_files() } ) {
38             #pod ...
39             #pod };
40             #pod
41             #pod =head1 DESCRIPTION
42             #pod
43             #pod This class consumes L<Dist::Zilla::Role::FileGatherer> and C<Dist::Zilla::Role::FileFinder> roles.
44             #pod In order to fulfill requirements, the class implements C<gather_files> and C<find_files> methods.
45             #pod Other methods are supporting.
46             #pod
47             #pod The class also consumes L<Dist::Zilla::Role::ErrorLogger> role. It allows the class not to stop
48             #pod at the first problem but continue and report multiple errors to user.
49             #pod
50             #pod =cut
51              
52             # --------------------------------------------------------------------------------------------------
53              
54             package Dist::Zilla::Plugin::Manifest::Read;
55              
56 1     1   3092542 use Moose;
  1         2  
  1         8  
57 1     1   8006 use namespace::autoclean;
  1         3  
  1         13  
58 1     1   115 use version 0.77;
  1         32  
  1         11  
59              
60             # ABSTRACT: Read annotated source manifest
61             our $VERSION = 'v0.4.2_04'; # TRIAL VERSION
62              
63             with 'Dist::Zilla::Role::FileGatherer';
64             with 'Dist::Zilla::Role::FileFinder';
65             with 'Dist::Zilla::Role::ErrorLogger' => { -version => 0.006 }; # need log_errors_in_file
66              
67 1     1   173 use Dist::Zilla::File::OnDisk;
  1         4  
  1         37  
68 1     1   6 use List::Util qw{ min max };
  1         2  
  1         106  
69 1     1   6 use Path::Tiny;
  1         2  
  1         62  
70 1     1   1069 use Set::Object qw{ set };
  1         10584  
  1         104  
71 1     1   11 use Try::Tiny;
  1         2  
  1         2321  
72              
73             # --------------------------------------------------------------------------------------------------
74              
75             #pod =attr manifest_name
76             #pod
77             #pod Name of manifest file to read.
78             #pod
79             #pod C<Str>, read-only, default value is C<MANIFEST>, C<init_arg> is C<manifest>.
80             #pod
81             #pod =cut
82              
83             has manifest_name => (
84             isa => 'Str',
85             is => 'ro',
86             default => 'MANIFEST',
87             init_arg => 'manifest',
88             );
89              
90             # --------------------------------------------------------------------------------------------------
91              
92             #pod =attr manifest_file
93             #pod
94             #pod Manifest file as a C<Dist::Zilla> file object (C<Dist::Zilla::File::OnDisk>).
95             #pod
96             #pod C<Object>, read-only.
97             #pod
98             #pod =cut
99              
100             has manifest_file => (
101             isa => 'Dist::Zilla::File::OnDisk',
102             is => 'ro',
103             lazy => 1,
104             builder => '_build_manifest_file',
105             init_arg => undef,
106             );
107              
108             sub _build_manifest_file {
109 7     7   12 my ( $self ) = @_;
110             # Straightforward appoach
111             # path( $self->manifest_name )
112             # is incorrect: it works only if the root directory is the current one, which is not always
113             # true. Following expression for manifest path is correct, but gives absolute (and often too
114             # long) name:
115             # path( $self->zilla->root )->child( $self->manifest )
116             # Let's try to shorten it. Hope this works:
117             # path( $self->zilla->root )->child( $self->manifest )->relative
118             # ...until someone changes the current directory...
119 7         334 return Dist::Zilla::File::OnDisk->new( {
120             name => path( $self->zilla->root )->child( $self->manifest_name )->relative . '',
121             } );
122             };
123              
124             # --------------------------------------------------------------------------------------------------
125              
126             #pod =method BUILD
127             #pod
128             #pod This method creates bunch of file finders: C<Manifest::Read/:AllFiles>, C<Manifest::Read/:ExecFiles>, C<Manifest::Read/:ExtraTestFiles>, C<Manifest::Read/:IncModules>, C<Manifest::Read/:InstallModules>, C<Manifest::Read/:NoFiles>, C<Manifest::Read/:PerlExecFiles>, C<Manifest::Read/:ShareFiles>, C<Manifest::Read/:TestFiles>.
129             #pod
130             #pod =cut
131              
132             sub BUILD {
133 7     7 1 16 my ( $self ) = @_;
134 7         777 require Dist::Zilla::Plugin::FinderCode;
135 7         38925 my $parent = $self;
136 7         330 my $zilla = $self->zilla;
137 7         87 my @finders = qw{ :AllFiles :ExecFiles :ExtraTestFiles :IncModules :InstallModules :NoFiles :PerlExecFiles :ShareFiles :TestFiles };
138 7         26 for my $name ( @finders ) {
139             my $finder = Dist::Zilla::Plugin::FinderCode->new( {
140             plugin_name => $parent->plugin_name . '/' . $name,
141             zilla => $zilla,
142             style => 'list',
143             code => sub {
144 11     11   32287 my ( $self ) = @_;
145 11         419 my $plugin = $self->zilla->plugin_named( $name );
146 11 50       13256 if ( not defined( $plugin ) ) {
147 0         0 $parent->abort( [ "Can't find plugin %s", $name ] );
148             };
149 11   100     560 my $files = $parent->_incl_file_set * set( @{ $plugin->find_files() // [] } );
  11         54  
150             # `:NoFiles` in `Dist::Zilla` 6.008 returns `undef`, not `[]`. ^^^^^
151 11         14764 return [ $files->members ];
152             },
153 63         2770 } );
154             # Let's provide old finder names for compatibility:
155             # TODO: Drop it in one or two releases.
156             my $compat = Dist::Zilla::Plugin::FinderCode->new( {
157 63         6744 plugin_name => do { $_ = $finder->plugin_name; $_ =~ s{/:}{/}x; $_ },
  63         2579  
  63         539  
  63         2332  
158             zilla => $finder->zilla,
159             style => $finder->style,
160             code => $finder->code,
161             } );
162 63         10861 push( @{ $zilla->plugins }, $finder, $compat );
  63         2085  
163             };
164 7         392 return;
165             };
166              
167             # --------------------------------------------------------------------------------------------------
168              
169             #pod =method gather_files
170             #pod
171             #pod This method fulfills L<Dist::Zilla::Role::FileGatherer> role requirement. It adds files listed in
172             #pod manifest to distribution. Files marked to exclude from distribution and directories are not added.
173             #pod
174             #pod =cut
175              
176             sub gather_files {
177 7     7 1 490453 my ( $self ) = @_;
178 7         427 for my $file ( $self->_incl_file_set->members ) {
179 47         24080 $self->add_file( $file );
180             };
181 4         2310 return;
182             };
183              
184             # --------------------------------------------------------------------------------------------------
185              
186             #pod =method find_files
187             #pod
188             #pod This method fulfills L<Dist::Zilla::Role::FileFinder> role requirement. It returns the I<complete>
189             #pod list (strictly speaking, arrayref) of files read from the manifest, in order of appearance.
190             #pod
191             #pod Note: The list includes files which are I<not> added to the distribution.
192             #pod
193             #pod Note: The method always returns the same list of files. Plugins which remove files from
194             #pod distribution (i. e. plugins which do C<Dist::Zilla::Role::FilePruner> role) do not affect result of
195             #pod the method.
196             #pod
197             #pod If you are interested in distribution files, have look to file finders generated by C<BUILD>.
198             #pod
199             #pod =cut
200              
201             has _complete_file_list => (
202             isa => 'ArrayRef',
203             is => 'ro',
204             lazy => 1,
205             builder => '_build_complete_file_list',
206             );
207              
208             sub _build_complete_file_list {
209 4     4   16 my ( $self ) = @_;
210             return [
211             map(
212 53         282 { $_->{ file } }
213             sort(
214 166         213 { $a->{ line } <=> $b->{ line } }
215 4         10 values( %{ $self->_manifest_bulk } )
  4         222  
216             )
217             )
218             ];
219             };
220              
221             sub find_files {
222 4     4 1 334174 my ( $self ) = @_;
223 4         8 return [ @{ $self->_complete_file_list } ];
  4         242  
224             };
225              
226             # --------------------------------------------------------------------------------------------------
227              
228             #pod =attr _incl_file_set
229             #pod
230             #pod Set of files (object which do C<Dist::Zilla::Role::File> role) listed in the manifest I<and> marked
231             #pod for inclusion to the distribution.
232             #pod
233             #pod =cut
234              
235             has _incl_file_set => (
236             isa => 'Set::Object',
237             is => 'ro',
238             lazy => 1,
239             builder => '_build_incl_file_set',
240             init_arg => undef,
241             );
242              
243             sub _build_incl_file_set {
244 7     7   32 my ( $self ) = @_;
245 7         372 my $m = $self->_manifest_bulk;
246 4         19 return set( map( { $_->{ file } } grep( { $_->{ mark } ne '-' } values( %$m ) ) ));
  47         85  
  53         118  
247             };
248              
249             # --------------------------------------------------------------------------------------------------
250              
251             #pod =attr _manifest_bulk
252             #pod
253             #pod Parsed manifest. HashRef. Keys are file names, values are HashRefs to inner hashes. Each inner hash
254             #pod has keys and associated values:
255             #pod
256             #pod =for :list
257             #pod = name
258             #pod Parsed filename (single-quoted filenames are unquoted, escape sequences are evaluated, if any).
259             #pod = file
260             #pod Object which does C<Dist::Zilla::Role::File> role.
261             #pod = mark
262             #pod Mark.
263             #pod = comment
264             #pod File comment, leading and trailing whitespaces are stripped.
265             #pod = line
266             #pod Number of manifest line the file listed in.
267             #pod
268             #pod C<HasfRef>, read-only, lazy, initialized with builder.
269             #pod
270             #pod =cut
271              
272             has _manifest_bulk => (
273             isa => 'HashRef[HashRef]',
274             is => 'ro',
275             lazy => 1,
276             builder => '_build_manifest_bulk',
277             init_arg => undef,
278             );
279              
280             sub _build_manifest_bulk {
281 7     7   16 my ( $self ) = @_;
282 7         15 my $items = {};
283 7         13 my @errors;
284             my $error = sub {
285 6     6   12 my ( $item, $message ) = @_;
286             my $err = sprintf(
287             '%s %s at %s line %d.',
288             $item->{ name }, $message, $self->manifest_name, $item->{ line },
289 6         371 );
290 6         19 push( @errors, $item->{ line } => $err );
291 6         22 return $self->log_error( $err );
292 7         59 };
293 7         35 foreach my $item ( $self->_parse_lines() ) {
294 60 100 50     2938 -e $item->{ name } or $error->( $item, 'does not exist' ) and next;
295 56 100       173 if ( $item->{ mark } eq '/' ) {
296 2 100 50     15 -d _ or $error->( $item, 'is not a directory' ) and next;
297             } else {
298 54 100 50     128 -f _ or $error->( $item, 'is not a plain file' ) and next;
299 53         2508 $item->{ file } = Dist::Zilla::File::OnDisk->new( { name => $item->{ name } } );
300 53         20916 $items->{ $item->{ name } } = $item;
301             };
302             };
303 5 100       428 if ( @errors ) {
304 1         64 $self->log_errors_in_file( $self->manifest_file, @errors );
305             };
306 5         5059 $self->abort_if_error();
307 4         482 return $items;
308             };
309              
310             # --------------------------------------------------------------------------------------------------
311              
312             #pod =attr _manifest_lines
313             #pod
314             #pod Array of chomped manifest lines, including comments and empty lines.
315             #pod
316             #pod C<ArrayRef[Str]>, read-only, lazy, initialized with builder.
317             #pod
318             #pod =cut
319              
320             has _manifest_lines => (
321             isa => 'ArrayRef[Str]',
322             is => 'ro',
323             lazy => 1,
324             init_arg => undef,
325             builder => '_build_manifest_lines',
326             );
327              
328             sub _build_manifest_lines {
329 7     7   13 my ( $self ) = @_;
330 7         18 my $lines = [];
331             try {
332 7     7   692 @$lines = split( "\n", $self->manifest_file->content );
333             } catch {
334 1     1   863 my $ex = $_;
335 1 50 33     22 if ( blessed( $ex ) and $ex->isa( 'Path::Tiny::Error' ) ) {
336 1         42 $self->abort( [ '%s: %s', $ex->{ file }, $ex->{ err } ] );
337             } else {
338 0         0 $self->abort( "$ex" );
339             };
340 7         90 };
341 6         6833 chomp( @$lines );
342 6         327 return $lines;
343             };
344              
345             # --------------------------------------------------------------------------------------------------
346              
347             #pod =method _parse_lines
348             #pod
349             #pod This method parses manifest lines. Each line is parsed separately (there is no line continuation).
350             #pod
351             #pod If the method fails to parse a line, error is reported by calling method C<log_error> (implemented
352             #pod in L<Dist::Zilla::Role::ErrorLogger>). This means that parsing is not stopped at the first failure,
353             #pod but entire manifest will be parsed and all the found errors will be reported.
354             #pod
355             #pod The method returns list of hashrefs, a hash per file. Each hash has following keys and values:
356             #pod
357             #pod =for :list
358             #pod = name
359             #pod Parsed filename (single-quoted filenames are unquoted, escape sequences are evaluated, if any).
360             #pod = mark
361             #pod Mark.
362             #pod = comment
363             #pod File comment, leading and trailing whitespaces are stripped.
364             #pod = line
365             #pod Number of manifest line (one-based) the file is listed in.
366             #pod
367             #pod =cut
368              
369             my %RE = (
370             name => qr{ ' (*PRUNE) (?: [^'\\] ++ | \\ ['\\] ?+ ) ++ ' | \S ++ }x,
371             # ^ TODO: Use Regexp::Common for quoted filename?
372             mark => qr{ [#/+-] }x,
373             comment => qr{ . *? }x,
374             );
375              
376             sub _parse_lines {
377 7     7   14 my ( $self ) = @_;
378 7         400 my $manifest = $self->manifest_name; # Shorter name.
379 7         13 my ( %files, @files );
380 0         0 my @errors;
381 7         29 my $n = 0;
382 7         15 for my $line ( @{ $self->_manifest_lines } ) {
  7         427  
383 75         83 ++ $n;
384 75 100       265 if ( $line =~ m{ \A \s * (?: \# | \z ) }x ) { # Comment or empty line.
385 9         18 next;
386             };
387             ## no critic ( ProhibitComplexRegexes )
388             $line =~ m{
389             \A
390             \s *+ # requires perl v5.10
391             ( $RE{ name } )
392             (*PRUNE) # requires perl v5.10
393             (?:
394             \s ++
395             ( $RE{ mark } )
396             (*PRUNE)
397             (?:
398             \s ++
399             ( $RE{ comment } )
400             ) ?
401             ) ?
402             \s *
403             \z
404             }x and do {
405 63         214 my ( $name, $mark, $comment ) = ( $1, $2, $3 );
406 63 100       236 if ( $name =~ s{ \A ' ( . * ) ' \z }{ $1 }ex ) {
  15         115  
407 15         55 $name =~ s{ \\ ( ['\\] ) }{ $1 }gex;
  6         25  
408             };
409 63 100       175 if ( exists( $files{ $name } ) ) {
410 2         4 my $f = $files{ $name };
411 2         12 $self->log_error( [ '%s at %s line %d', $name, $manifest, $n ] );
412 2         798 $self->log_error( [ ' also listed at %s line %d.', $manifest, $f->{ line } ] );
413             push( @errors,
414             $n => 'The file also listed at line ' . $f->{ line } . '.',
415 2         770 $f->{ line } => 'The file also listed at line ' . $n . '.',
416             );
417 2         8 next;
418             };
419 61   100     361 my $file = {
420             name => $name,
421             mark => $mark // '+', # requires perl v5.10
422             comment => $comment,
423             line => $n,
424             };
425 61         169 $files{ $name } = $file;
426 61         92 push( @files, $file );
427 61         241 1;
428 66 100 66     977 } or do {
429 3         23 my $error = sprintf( 'Syntax error at %s line %d.', $manifest, $n );
430 3         14 $self->log_error( $error );
431 3         1255 push( @errors, $n => $error );
432 3         10 next;
433             };
434             };
435 6 100       25 if ( @errors ) {
436 1         66 $self->log_errors_in_file( $self->manifest_file, @errors );
437 1         5876 $self->abort();
438             };
439 5         44 return @files;
440             };
441              
442             # --------------------------------------------------------------------------------------------------
443              
444             __PACKAGE__->meta->make_immutable;
445              
446             1;
447              
448             # --------------------------------------------------------------------------------------------------
449              
450             #pod =pod
451             #pod
452             #pod =encoding UTF-8
453             #pod
454             #pod =head1 WHAT?
455             #pod
456             #pod C<Dist-Zilla-Plugin-Manifest-Read> (or C<Manifest::Read> for brevity) is a C<Dist::Zilla> plugin. It reads
457             #pod I<annotated source> manifest, checks existence of all listed files and directories, and adds
458             #pod selected files to the distribution. C<Manifest::Read> also does C<FileFinder> role, providing the
459             #pod list of files for other plugins.
460             #pod
461             #pod =cut
462              
463              
464             #pod =head1 SEE ALSO
465             #pod
466             #pod =for :list
467             #pod = L<Dist::Zilla>
468             #pod = L<Dist::Zilla::Role::FileGatherer>
469             #pod = L<Dist::Zilla::Role::ErrorLogger>
470             #pod
471             #pod =head1 COPYRIGHT AND LICENSE
472             #pod
473             #pod Copyright (C) 2015, 2016 Van de Bugger
474             #pod
475             #pod License GPLv3+: The GNU General Public License version 3 or later
476             #pod <http://www.gnu.org/licenses/gpl-3.0.txt>.
477             #pod
478             #pod This is free software: you are free to change and redistribute it. There is
479             #pod NO WARRANTY, to the extent permitted by law.
480             #pod
481             #pod
482             #pod =cut
483              
484             # end of file #
485              
486             __END__
487              
488             =pod
489              
490             =encoding UTF-8
491              
492             =head1 NAME
493              
494             Dist::Zilla::Plugin::Manifest::Read - Read annotated source manifest
495              
496             =head1 VERSION
497              
498             Version v0.4.2_04, released on 2016-11-17 21:52 UTC.
499             This is a B<trial release>.
500              
501             =head1 WHAT?
502              
503             C<Dist-Zilla-Plugin-Manifest-Read> (or C<Manifest::Read> for brevity) is a C<Dist::Zilla> plugin. It reads
504             I<annotated source> manifest, checks existence of all listed files and directories, and adds
505             selected files to the distribution. C<Manifest::Read> also does C<FileFinder> role, providing the
506             list of files for other plugins.
507              
508             This is C<Dist::Zilla::Plugin::Manifest::Read> module documentation. Read this if you are going to hack or
509             extend C<Manifest::Read>, or use it programmatically.
510              
511             If you want to have annotated source manifest, read the L<user manual|Dist::Zilla::Plugin::Manifest::Read::Manual>.
512             General topics like getting source, building, installing, bug reporting and some others are covered
513             in the F<README>.
514              
515             =for test_synopsis my $self;
516              
517             =head1 SYNOPSIS
518              
519             In your plugin:
520              
521             # Iterate through the distribution files listed in MANIFEST:
522             my $finder = $self->zilla->plugin_named( 'Manifest::Read/:AllFiles' );
523             for my $file ( @{ $finder->find_files() } ) {
524             ...
525             };
526              
527             =head1 DESCRIPTION
528              
529             This class consumes L<Dist::Zilla::Role::FileGatherer> and C<Dist::Zilla::Role::FileFinder> roles.
530             In order to fulfill requirements, the class implements C<gather_files> and C<find_files> methods.
531             Other methods are supporting.
532              
533             The class also consumes L<Dist::Zilla::Role::ErrorLogger> role. It allows the class not to stop
534             at the first problem but continue and report multiple errors to user.
535              
536             =head1 OBJECT ATTRIBUTES
537              
538             =head2 manifest_name
539              
540             Name of manifest file to read.
541              
542             C<Str>, read-only, default value is C<MANIFEST>, C<init_arg> is C<manifest>.
543              
544             =head2 manifest_file
545              
546             Manifest file as a C<Dist::Zilla> file object (C<Dist::Zilla::File::OnDisk>).
547              
548             C<Object>, read-only.
549              
550             =head2 _incl_file_set
551              
552             Set of files (object which do C<Dist::Zilla::Role::File> role) listed in the manifest I<and> marked
553             for inclusion to the distribution.
554              
555             =head2 _manifest_bulk
556              
557             Parsed manifest. HashRef. Keys are file names, values are HashRefs to inner hashes. Each inner hash
558             has keys and associated values:
559              
560             =over 4
561              
562             =item name
563              
564             Parsed filename (single-quoted filenames are unquoted, escape sequences are evaluated, if any).
565              
566             =item file
567              
568             Object which does C<Dist::Zilla::Role::File> role.
569              
570             =item mark
571              
572             Mark.
573              
574             =item comment
575              
576             File comment, leading and trailing whitespaces are stripped.
577              
578             =item line
579              
580             Number of manifest line the file listed in.
581              
582             =back
583              
584             C<HasfRef>, read-only, lazy, initialized with builder.
585              
586             =head2 _manifest_lines
587              
588             Array of chomped manifest lines, including comments and empty lines.
589              
590             C<ArrayRef[Str]>, read-only, lazy, initialized with builder.
591              
592             =head1 OBJECT METHODS
593              
594             =head2 BUILD
595              
596             This method creates bunch of file finders: C<Manifest::Read/:AllFiles>, C<Manifest::Read/:ExecFiles>, C<Manifest::Read/:ExtraTestFiles>, C<Manifest::Read/:IncModules>, C<Manifest::Read/:InstallModules>, C<Manifest::Read/:NoFiles>, C<Manifest::Read/:PerlExecFiles>, C<Manifest::Read/:ShareFiles>, C<Manifest::Read/:TestFiles>.
597              
598             =head2 gather_files
599              
600             This method fulfills L<Dist::Zilla::Role::FileGatherer> role requirement. It adds files listed in
601             manifest to distribution. Files marked to exclude from distribution and directories are not added.
602              
603             =head2 find_files
604              
605             This method fulfills L<Dist::Zilla::Role::FileFinder> role requirement. It returns the I<complete>
606             list (strictly speaking, arrayref) of files read from the manifest, in order of appearance.
607              
608             Note: The list includes files which are I<not> added to the distribution.
609              
610             Note: The method always returns the same list of files. Plugins which remove files from
611             distribution (i. e. plugins which do C<Dist::Zilla::Role::FilePruner> role) do not affect result of
612             the method.
613              
614             If you are interested in distribution files, have look to file finders generated by C<BUILD>.
615              
616             =head2 _parse_lines
617              
618             This method parses manifest lines. Each line is parsed separately (there is no line continuation).
619              
620             If the method fails to parse a line, error is reported by calling method C<log_error> (implemented
621             in L<Dist::Zilla::Role::ErrorLogger>). This means that parsing is not stopped at the first failure,
622             but entire manifest will be parsed and all the found errors will be reported.
623              
624             The method returns list of hashrefs, a hash per file. Each hash has following keys and values:
625              
626             =over 4
627              
628             =item name
629              
630             Parsed filename (single-quoted filenames are unquoted, escape sequences are evaluated, if any).
631              
632             =item mark
633              
634             Mark.
635              
636             =item comment
637              
638             File comment, leading and trailing whitespaces are stripped.
639              
640             =item line
641              
642             Number of manifest line (one-based) the file is listed in.
643              
644             =back
645              
646             =head1 SEE ALSO
647              
648             =over 4
649              
650             =item L<Dist::Zilla>
651              
652             =item L<Dist::Zilla::Role::FileGatherer>
653              
654             =item L<Dist::Zilla::Role::ErrorLogger>
655              
656             =back
657              
658             =head1 AUTHOR
659              
660             Van de Bugger <van.de.bugger@gmail.com>
661              
662             =head1 COPYRIGHT AND LICENSE
663              
664             Copyright (C) 2015, 2016 Van de Bugger
665              
666             License GPLv3+: The GNU General Public License version 3 or later
667             <http://www.gnu.org/licenses/gpl-3.0.txt>.
668              
669             This is free software: you are free to change and redistribute it. There is
670             NO WARRANTY, to the extent permitted by law.
671              
672             =cut