NAME

Linux::Info::Distribution::Custom - custom files data of a Linux distribution

VERSION

version 2.12

DESCRIPTION

This class is a subclass of Linux::Info::Distribution.

It will provide basic interfaces for subclasses of it to handle the different variations of text file containing the distribution informations.

Subclasses are required to override two "private" methods in order to inherit from this class:

  • _set_regex sets the regex attribute with the regular expression required to parse the file content (usually a single line). This expression must use named match groups to extract available information that is relevant.

  • _set_others sets all other fields available on the subclass, which will have their values extracted from the match groups.

    This method will receive as a parameter a hash reference, which will contain the extract values using the regular expression groups, and such information should be used to build or be directly used in the subclass attributes.

Both of those methods are invoked during the execution of new.

METHODS

new

Creates and returns a new instance of this class.

Expects as parameter a instance of Linux::Info::Distribution::BasicInfo.

get_source

Returns a string with the complete path to the file that provided the distribution information.

get_regex

Returns the compiled regular expression created to parse this instance source file.

EXPORTS

Nothing.

AUTHOR

Alceu Rodrigues de Freitas Junior <glasswalk3r@yahoo.com.br>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by Alceu Rodrigues de Freitas Junior.

This is free software, licensed under:

The GNU General Public License, Version 3, June 2007