Skip to content

kentnl/Gentoo-MetaEbuild-Spec-Base

Repository files navigation

NAME

Gentoo::MetaEbuild::Spec::Base - A Base Class for Gentoo MetaEbuild Specifications.

VERSION

version 1.000003

SYNOPSIS

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.

METHODS

check

Packagename->check( $datastructure );

Packagename->check( $datastructure, \%opts );

Packagename->check( $datastructure, { version => '0.1.0' });

EXTENDING

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.

TESTING

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();

AUTHOR

Kent Fredric kentnl@cpan.org

COPYRIGHT AND LICENSE

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.

About

A Base Class for Gentoo MetaEbuild Specifications.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages