Gentoo::MetaEbuild::Spec::Base - A Base Class for Gentoo MetaEbuild Specifications.
version 1.000002
use Gentoo::MetaEbuild::Spec::Base; # or some derived class Gentoo::MetaEbuild::Spec::Base->check( $datastructure );
This base-class only validates the most basic of basic, that the data is a { } using Data::Rx and using the shipped File::ShareDir v1.0.0.json spec to do that.
This will be more practical in consuming classes as they'll override selected methods/ship different spec files, but maintain the same useful interface.
Packagename->check( $datastructure ); Packagename->check( $datastructure, \%opts ); Packagename->check( $datastructure, { version => '0.1.0' });
Extending should be this simple:
package FooBarBaz; use Moose; extends 'Gentoo::MetaEbuild::Spec::Base'; 1;
and then ship a directory of Data::Rx spec files as the Module ShareDir for that module.
The only fun thing with testing is the File::ShareDir directory hasn't been installed yet, but its simple to get around.
use FindBin; use Path::Tiny qw( path ); use Gentoo::MetaEbuild::Spec::Base; Gentoo::MetaEbuild::Spec::Base->_spec_dir( path($FindBin::Bin)->parent->child('share') ); # Code as per usual. my $shareroot = path($FindBin::Bin)->parent();
Kent Fredric <kentnl@cpan.org>
This software is copyright (c) 2017 by Kent Fredric <kentnl@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Gentoo::MetaEbuild::Spec::Base, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gentoo::MetaEbuild::Spec::Base
CPAN shell
perl -MCPAN -e shell install Gentoo::MetaEbuild::Spec::Base
For more information on module installation, please visit the detailed CPAN module installation guide.