Module::Changes::Formatter::YAML - format a Changes object as YAML


Module-Changes documentation Contained in the Module-Changes distribution.

Index


Code Index:

NAME

Top

Module::Changes::Formatter::YAML - format a Changes object as YAML

SYNOPSIS

Top

    use Module::Changes;
    my $formatter = Module::Changes->make_object_for_type('formatter_yaml');
    $formatter->format($changes);

DESCRIPTION

Top

This class can format a Changes object as YAML. The layout of the YAML file is documented in Module::Changes.

METHODS

Top

This class inherits all methods from Module::Changes::Formatter.

format
    print $formatter->format($changes);

Takes a changes object and formats it as YAML, then returns the result string.

TAGS

Top

If you talk about this module in blogs, on del.icio.us or anywhere else, please use the modulechanges tag.

BUGS AND LIMITATIONS

Top

No bugs have been reported.

Please report any bugs or feature requests to bug-module-changes@rt.cpan.org, or through the web interface at http://rt.cpan.org.

INSTALLATION

Top

See perlmodinstall for information and options on installing Perl modules.

AVAILABILITY

Top

The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a CPAN site near you. Or see <http://www.perl.com/CPAN/authors/id/M/MA/MARCEL/>.

AUTHOR

Top

Marcel Grünauer, <marcel@cpan.org>

COPYRIGHT AND LICENSE

Top


Module-Changes documentation Contained in the Module-Changes distribution.

package Module::Changes::Validator::YAML;

use warnings;
use strict;
use Kwalify ();
use YAML;;


our $VERSION = '0.05';


use base 'Module::Changes::Base';


my $schema = Load(<<EOSCHEMA);
type: map
mapping:
    global:
        type: map
        mapping:
            name:
                type: str
                required: yes
    releases:
        type: seq
        sequence:
            - type: map
              mapping:
                  version:
                      type: scalar
                      required: yes
                  author:
                      type: str
                      required: yes
                  changes:
                      type: seq
                      sequence:
                        - type: str
                  date:
                      type: str
                      required: yes
                  tags:
                      type: seq
                      sequence:
                        - type: str
EOSCHEMA


sub validate {
    my ($self, $yaml) = @_;
    Kwalify::validate($schema, $yaml);
}


1;

__END__