| CPAN-Packager documentation | Contained in the CPAN-Packager distribution. |
CPAN::Packager::Config::Validator - validates configration
Takatoshi Kitano <kitano.tk@gmail.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| CPAN-Packager documentation | Contained in the CPAN-Packager distribution. |
package CPAN::Packager::Config::Validator; use strict; use warnings; use CPAN::Packager::Config::Schema; use Kwalify; use Log::Log4perl qw(:easy); sub validate { my ( $class, $config ) = @_; my $schema = CPAN::Packager::Config::Schema->schema(); $class->_validate_config( $config, $schema ); } sub _validate_config { my ( $class, $config, $schema ) = @_; if ($schema) { my $res = Kwalify::validate( $schema, $config ); unless ( $res == 1 ) { die "config.yaml validation error : $res"; } } else { WARN("Kwalify is not installed. Skipping the config validation."); } } 1; __END__