Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kentnl/gentoo-metaebuild-spec-base
A Base Class for Gentoo MetaEbuild Specifications.
https://github.com/kentnl/gentoo-metaebuild-spec-base
Last synced: 4 days ago
JSON representation
A Base Class for Gentoo MetaEbuild Specifications.
- Host: GitHub
- URL: https://github.com/kentnl/gentoo-metaebuild-spec-base
- Owner: kentnl
- License: other
- Created: 2011-02-21T07:04:25.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2017-03-10T10:12:20.000Z (over 7 years ago)
- Last Synced: 2023-08-20T22:55:47.122Z (about 1 year ago)
- Language: Perl
- Size: 147 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.mkdn
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# 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
# COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Kent Fredric .
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.