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   2186646 use Moose;
  1         3  
  1         6  
57 1     1   5143 use namespace::autoclean;
  1         1  
  1         11  
58 1     1   108 use version 0.77;
  1         33  
  1         8  
59              
60             # ABSTRACT: Read annotated source manifest
61             our $VERSION = 'v0.5.0'; # 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   102 use Dist::Zilla::File::OnDisk;
  1         2  
  1         26  
68 1     1   5 use List::Util qw{ min max };
  1         2  
  1         78  
69 1     1   5 use Path::Tiny;
  1         1  
  1         46  
70 1     1   709 use Set::Object qw{ set };
  1         6168  
  1         44  
71 1     1   6 use Try::Tiny;
  1         2  
  1         1521  
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   16 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         298 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 29 my ( $self ) = @_;
134 7         813 require Dist::Zilla::Plugin::FinderCode;
135 7         30577 my $parent = $self;
136 7         319 my $zilla = $self->zilla;
137 7         102 my @finders = qw{ :AllFiles :ExecFiles :ExtraTestFiles :IncModules :InstallModules :NoFiles :PerlExecFiles :ShareFiles :TestFiles };
138 7         24 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   24951 my ( $self ) = @_;
145 11         325 my $plugin = $self->zilla->plugin_named( $name );
146 11 50       9888 if ( not defined( $plugin ) ) {
147 0         0 $parent->abort( [ "Can't find plugin %s", $name ] );
148             };
149 11   100     485 my $files = $parent->_incl_file_set * set( @{ $plugin->find_files() // [] } );
  11         37  
150             # `:NoFiles` in `Dist::Zilla` 6.008 returns `undef`, not `[]`. ^^^^^
151 11         11926 return [ $files->members ];
152             },
153 63         3007 } );
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         7287 plugin_name => do { $_ = $finder->plugin_name; $_ =~ s{/:}{/}x; $_ },
  63         2795  
  63         572  
  63         2523  
158             zilla => $finder->zilla,
159             style => $finder->style,
160             code => $finder->code,
161             } );
162 63         11468 push( @{ $zilla->plugins }, $finder, $compat );
  63         2315  
163             };
164 7         341 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 567087 my ( $self ) = @_;
178 7         429 for my $file ( $self->_incl_file_set->members ) {
179 47         19879 $self->add_file( $file );
180             };
181 4         1718 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   11 my ( $self ) = @_;
210             return [
211             map(
212 53         290 { $_->{ file } }
213             sort(
214 170         224 { $a->{ line } <=> $b->{ line } }
215 4         8 values( %{ $self->_manifest_bulk } )
  4         218  
216             )
217             )
218             ];
219             };
220              
221             sub find_files {
222 4     4 1 307920 my ( $self ) = @_;
223 4         11 return [ @{ $self->_complete_file_list } ];
  4         217  
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   15 my ( $self ) = @_;
245 7         353 my $m = $self->_manifest_bulk;
246 4         18 return set( map( { $_->{ file } } grep( { $_->{ mark } ne '-' } values( %$m ) ) ));
  47         82  
  53         101  
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   14 my ( $self ) = @_;
282 7         15 my $items = {};
283 7         12 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         281 );
290 6         16 push( @errors, $item->{ line } => $err );
291 6         22 return $self->log_error( $err );
292 7         67 };
293 7         36 foreach my $item ( $self->_parse_lines() ) {
294 60 100 50     2359 -e $item->{ name } or $error->( $item, 'does not exist' ) and next;
295 56 100       143 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     109 -f _ or $error->( $item, 'is not a plain file' ) and next;
299 53         2320 $item->{ file } = Dist::Zilla::File::OnDisk->new( { name => $item->{ name } } );
300 53         16487 $items->{ $item->{ name } } = $item;
301             };
302             };
303 5 100       386 if ( @errors ) {
304 1         45 $self->log_errors_in_file( $self->manifest_file, @errors );
305             };
306 5         3648 $self->abort_if_error();
307 4         421 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         20 my $lines = [];
331             try {
332 7     7   670 @$lines = split( "\n", $self->manifest_file->content );
333             } catch {
334 1     1   757 my $ex = $_;
335 1 50 33     18 if ( blessed( $ex ) and $ex->isa( 'Path::Tiny::Error' ) ) {
336 1         31 $self->abort( [ '%s: %s', $ex->{ file }, $ex->{ err } ] );
337             } else {
338 0         0 $self->abort( "$ex" );
339             };
340 7         103 };
341 6         7288 chomp( @$lines );
342 6         323 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   15 my ( $self ) = @_;
378 7         372 my $manifest = $self->manifest_name; # Shorter name.
379 7         12 my ( %files, @files );
380 0         0 my @errors;
381 7         23 my $n = 0;
382 7         15 for my $line ( @{ $self->_manifest_lines } ) {
  7         362  
383 75         89 ++ $n;
384 75 100       238 if ( $line =~ m{ \A \s * (?: \# | \z ) }x ) { # Comment or empty line.
385 9         10 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         157 my ( $name, $mark, $comment ) = ( $1, $2, $3 );
406 63 100       160 if ( $name =~ s{ \A ' ( . * ) ' \z }{ $1 }ex ) {
  15         49  
407 15         26 $name =~ s{ \\ ( ['\\] ) }{ $1 }gex;
  6         13  
408             };
409 63 100       149 if ( exists( $files{ $name } ) ) {
410 2         5 my $f = $files{ $name };
411 2         16 $self->log_error( [ '%s at %s line %d', $name, $manifest, $n ] );
412 2         891 $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         889 $f->{ line } => 'The file also listed at line ' . $n . '.',
416             );
417 2         9 next;
418             };
419 61   100     257 my $file = {
420             name => $name,
421             mark => $mark // '+', # requires perl v5.10
422             comment => $comment,
423             line => $n,
424             };
425 61         160 $files{ $name } = $file;
426 61         66 push( @files, $file );
427 61         201 1;
428 66 100 66     778 } or do {
429 3         26 my $error = sprintf( 'Syntax error at %s line %d.', $manifest, $n );
430 3         19 $self->log_error( $error );
431 3         1365 push( @errors, $n => $error );
432 3         13 next;
433             };
434             };
435 6 100       18 if ( @errors ) {
436 1         71 $self->log_errors_in_file( $self->manifest_file, @errors );
437 1         5849 $self->abort();
438             };
439 5         37 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.5.0, released on 2016-11-21 19:18 UTC.
499              
500             =head1 WHAT?
501              
502             C<Dist-Zilla-Plugin-Manifest-Read> (or C<Manifest::Read> for brevity) is a C<Dist::Zilla> plugin. It reads
503             I<annotated source> manifest, checks existence of all listed files and directories, and adds
504             selected files to the distribution. C<Manifest::Read> also does C<FileFinder> role, providing the
505             list of files for other plugins.
506              
507             This is C<Dist::Zilla::Plugin::Manifest::Read> module documentation. Read this if you are going to hack or
508             extend C<Manifest::Read>, or use it programmatically.
509              
510             If you want to have annotated source manifest, read the L<user manual|Dist::Zilla::Plugin::Manifest::Read::Manual>.
511             General topics like getting source, building, installing, bug reporting and some others are covered
512             in the F<README>.
513              
514             =for test_synopsis my $self;
515              
516             =head1 SYNOPSIS
517              
518             In your plugin:
519              
520             # Iterate through the distribution files listed in MANIFEST:
521             my $finder = $self->zilla->plugin_named( 'Manifest::Read/:AllFiles' );
522             for my $file ( @{ $finder->find_files() } ) {
523             ...
524             };
525              
526             =head1 DESCRIPTION
527              
528             This class consumes L<Dist::Zilla::Role::FileGatherer> and C<Dist::Zilla::Role::FileFinder> roles.
529             In order to fulfill requirements, the class implements C<gather_files> and C<find_files> methods.
530             Other methods are supporting.
531              
532             The class also consumes L<Dist::Zilla::Role::ErrorLogger> role. It allows the class not to stop
533             at the first problem but continue and report multiple errors to user.
534              
535             =head1 OBJECT ATTRIBUTES
536              
537             =head2 manifest_name
538              
539             Name of manifest file to read.
540              
541             C<Str>, read-only, default value is C<MANIFEST>, C<init_arg> is C<manifest>.
542              
543             =head2 manifest_file
544              
545             Manifest file as a C<Dist::Zilla> file object (C<Dist::Zilla::File::OnDisk>).
546              
547             C<Object>, read-only.
548              
549             =head2 _incl_file_set
550              
551             Set of files (object which do C<Dist::Zilla::Role::File> role) listed in the manifest I<and> marked
552             for inclusion to the distribution.
553              
554             =head2 _manifest_bulk
555              
556             Parsed manifest. HashRef. Keys are file names, values are HashRefs to inner hashes. Each inner hash
557             has keys and associated values:
558              
559             =over 4
560              
561             =item name
562              
563             Parsed filename (single-quoted filenames are unquoted, escape sequences are evaluated, if any).
564              
565             =item file
566              
567             Object which does C<Dist::Zilla::Role::File> role.
568              
569             =item mark
570              
571             Mark.
572              
573             =item comment
574              
575             File comment, leading and trailing whitespaces are stripped.
576              
577             =item line
578              
579             Number of manifest line the file listed in.
580              
581             =back
582              
583             C<HasfRef>, read-only, lazy, initialized with builder.
584              
585             =head2 _manifest_lines
586              
587             Array of chomped manifest lines, including comments and empty lines.
588              
589             C<ArrayRef[Str]>, read-only, lazy, initialized with builder.
590              
591             =head1 OBJECT METHODS
592              
593             =head2 BUILD
594              
595             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>.
596              
597             =head2 gather_files
598              
599             This method fulfills L<Dist::Zilla::Role::FileGatherer> role requirement. It adds files listed in
600             manifest to distribution. Files marked to exclude from distribution and directories are not added.
601              
602             =head2 find_files
603              
604             This method fulfills L<Dist::Zilla::Role::FileFinder> role requirement. It returns the I<complete>
605             list (strictly speaking, arrayref) of files read from the manifest, in order of appearance.
606              
607             Note: The list includes files which are I<not> added to the distribution.
608              
609             Note: The method always returns the same list of files. Plugins which remove files from
610             distribution (i. e. plugins which do C<Dist::Zilla::Role::FilePruner> role) do not affect result of
611             the method.
612              
613             If you are interested in distribution files, have look to file finders generated by C<BUILD>.
614              
615             =head2 _parse_lines
616              
617             This method parses manifest lines. Each line is parsed separately (there is no line continuation).
618              
619             If the method fails to parse a line, error is reported by calling method C<log_error> (implemented
620             in L<Dist::Zilla::Role::ErrorLogger>). This means that parsing is not stopped at the first failure,
621             but entire manifest will be parsed and all the found errors will be reported.
622              
623             The method returns list of hashrefs, a hash per file. Each hash has following keys and values:
624              
625             =over 4
626              
627             =item name
628              
629             Parsed filename (single-quoted filenames are unquoted, escape sequences are evaluated, if any).
630              
631             =item mark
632              
633             Mark.
634              
635             =item comment
636              
637             File comment, leading and trailing whitespaces are stripped.
638              
639             =item line
640              
641             Number of manifest line (one-based) the file is listed in.
642              
643             =back
644              
645             =head1 SEE ALSO
646              
647             =over 4
648              
649             =item L<Dist::Zilla>
650              
651             =item L<Dist::Zilla::Role::FileGatherer>
652              
653             =item L<Dist::Zilla::Role::ErrorLogger>
654              
655             =back
656              
657             =head1 AUTHOR
658              
659             Van de Bugger <van.de.bugger@gmail.com>
660              
661             =head1 COPYRIGHT AND LICENSE
662              
663             Copyright (C) 2015, 2016 Van de Bugger
664              
665             License GPLv3+: The GNU General Public License version 3 or later
666             <http://www.gnu.org/licenses/gpl-3.0.txt>.
667              
668             This is free software: you are free to change and redistribute it. There is
669             NO WARRANTY, to the extent permitted by law.
670              
671             =cut