The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CPAN::Index::API::Role::Writer - Role for writing index files

VERSION

version 0.004

DESCRIPTION

This role provides attributes and methods shared between classes that write index files.

REQUIRES

default_location

Class method that returns a string specifying the path to the default location of this file relative to the repository root.

__DATA__

Consuming packages are expected to have a DATA section that contains the template to use for generating the file contents.

PROVIDES

tarball_is_default

Required attribute. Boolean - indicates whether the file should be compressed by default. Automatically set to true if the file path in default_location ends in .gz.

repo_path

Optional attribute. Path to the repository root.

template

Optional attribute. The template to use for generating the index files. The defalt is fetched from the DATA section of the consuming package.

content

Optional attribute. The index file content. Built by default from the provided "template".

rebuild_content

content is a lazy read-only attribute which normally is built only once. Use rebuild_content to generate a new value for content if you've made changes to the list of packages.

write_to_file

This method builds the file content if necessary and writes it to a file. A path to a file to write to can be passed as an argument, otherwise the default location will be used (a .gz suffix, if it exists, will be removed).

write_to_tarball

This method builds the file content if necessary and writes it to a tarball. A path to a file to write to can be passed as an argument, otherwise the default location will be used.

write_to_default_location

This method builds the file content if necessary and writes it to the default location.

AUTHOR

Peter Shangov <pshangov@yahoo.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Venda, Inc..

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.