NAME

Dist::Zilla::Plugin::Manifest::Read - Read extended MANIFEST file

VERSION

Version v0.3.1, released on 2015-09-23 11:45 UTC.

This is Dist::Zilla::Plugin::Manifest::Read module documentation. Read this if you are going to hack or extend Dist-Zilla-Plugin-Manifest-Read, or use it programmatically.

If you want to have annotated manifest in your source, read the user manual. General topics like getting source, building, installing, bug reporting and some others are covered in the README.

SYNOPSIS

In your plugin:

# Iterate through the distribution files listed in MANIFEST
# (files not included into distrubution are not iterated):
my $files = $self->zilla->plugin_named( 'Manifest::Read' )->find_files();
for my $file ( @$files ) {
    …
};

DESCRIPTION

This class consumes Dist::Zilla::Role::FileGatherer and Dist::Zilla::Role::FileFinder role. In order to fulfill requirements, the class implements gather_files and find_files methods. Other methods are supporting.

The class also consumes Dist::Zilla::Role::ErrorReporter role. It allows the class not to stop at the first problem but continue and report multiple errors to user.

OBJECT ATTRIBUTES

manifest_name

Name of manifest file to read.

Str, read-only, default value is MANIFEST, init_arg is manifest.

manifest_file

Manifest file as a Dist::Zilla file object (Dist::Zilla::File::OnDisk).

Object, read-only.

_files

Array of files (object of Dist::Zilla::File::OnDisk class) listed in the manifest and marked for inclusion to the distribution.

ArrayRef, read-only, lazy, initialized with builder.

_lines

Array of chomped manifest lines, including comments and empty lines.

ArrayRef[Str], read-only, lazy, initialized with builder.

OBJECT METHODS

gather_files

This method fulfills Dist::Zilla::Role::FileGatherer role requirement. It adds files listed in manifest to distribution. Files marked to exclude from distribution and directories are not added, though.

find_files

This method fulfills Dist::Zilla::Role::FileFinder role requirement. It returns ArrayRef of files (objects of Dist::Zilla::File::OnDisk class), listed in manifest and marked for inclusion to the distribution.

This method can be called by other plugins to iterate through files added by Manifest::Read, see "SYNOPSIS".

Note: Plugins which remove files from distribution (i. e. plugins which do FilePruner role) do not affect result of this method.

_parse_lines

This method parses manifest lines. Each line is parsed separately (there is no line continuation).

If the method fails to parse a line, error is reported by calling method log_error (implemented in Dist::Zilla::Role::ErrorLogger). This means that parsing is not stopped at the first failure, but entire manifest will be parsed and all the found errors will be reported.

The method returns list of hashrefs, a hash per file. Each hash has following keys and values:

filename

Parsed filename (single-quoted filenames are unquoted, escape sequences are evaluated, if any).

marker

Marker.

comment

File comment, leading and trailed whitespaces are stripped.

line

Number of manifest line the file listed in.

SEE ALSO

Dist::Zilla
Dist::Zilla::Role::FileGatherer
Dist::Zilla::Role::ErrorLogger
Dist::Zilla::Plugin::GatherFromManifest

AUTHOR

Van de Bugger <van.de.bugger@gmail.com>

COPYRIGHT AND LICENSE

Copyright © 2015 Van de Bugger

This file is part of perl-Dist-Zilla-Plugin-Manifest-Read.

perl-Dist-Zilla-Plugin-Manifest-Read is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

perl-Dist-Zilla-Plugin-Manifest-Read is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with perl-Dist-Zilla-Plugin-Manifest-Read. If not, see <http://www.gnu.org/licenses/>.