Advanced-Config

 view release on metacpan or  search on metacpan

t/config/65-good-rule-config.cfg  view on Meta::CPAN

#
# This is a sample config rule file.  It tells how to manage other config files.
#
# It is meant to be accessed via new_DefineConfigRules()
# Which will load it into memory & mark it as read-only.
#
# This config file object must follow specific rules
#
# It may only define tags that can be found in one of the opts hashes,
#             new->($filname, \%read_opts, \%get_opts, \%date_opts)
# Please review the pod for Advanced::Config::Options for what these
# option are.
#
# Defining tags not mentioned in the pod is treated as a fatal error.  Tag
# names are case insensitve.  As are the section names.
#
# This file is broken up into sections which are named after the config files
# it's controlling.  If no match is found it attempts to use wildcard matching
# to find the rules to use, like "*.cfg".
#
# There is only one required section, "*", which is catch all for catching a
# file that didn't match anything else.  Matching more than 1 section is a
# fatal error.
# ------------------------------------------------------------------------------
# Examples:
#     Sample.cfg      --> matches section "*.cfg"
#     tom_data.CFG    --> matches 2 sections   "tom*.cfg" & "*.cfg"
#     Tom_and_BOB.cfg --> matches 3 sections   "tom*.cfg", "*bob*" & "*.cfg"
#     mary.conf       --> has no match, so uses section "*"
#
# Matching multiple sections is a fatal error so a special tag is allowed to
# give preference to a particular match.  That tag is __ORDER__ which must
# have an unique integer value.  The section with the lowest value break the
# tie.
# ------------------------------------------------------------------------------


# These options are inherited by all the other sections that don't override them
croak = 1
assign = :=

inherit = 1

# The catch all section
[ * ]

comment = //


# catch all for any file ending in ".cfg"
[ *.cfg ]

    __ORDER__ = 100100  # Some big number so will be picked last.
    assign = =
comment = @


# any file starting with "tom" and ending with ".cfg"
[ tom*.cfg ]

    __ORDER__ = 50      # Same as "*bob*" so it's a fatal error if both match
    quote_left = >
    quote_right = <


# any file with "bob" in it's name.
[ *Bob* ]
    disable_quotes = 1
    __ORDER__ = 50      # Same as "tom*.cfg" so it's a fatal error if both match
    quote_left = (
    quote_right = )

    # show that there is no tag validation right now
    source_cb = abc::xyz


# This is an exact match only.
[ 65-my-config-file.cfg ]

source = include



( run in 0.670 second using v1.01-cache-2.11-cpan-b301d465b3d )