App::G...:Config(3pm)

πŸ“¦
version 1.9.0 Β· 2 versions
, in fedora 43

✨ NAME ✨

App::GitHooks::Config β€” the configuration manager for App::GitHooks, bestie πŸ’–

No cap, this is the module that holds all your settings and hands them back when somebody asks nicely.


🌸 VERSION 🌸

Version 1.9.0 β€” she's giving stable, she's giving shipped πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

my $config = App::GitHooks::Config->new();

my $config = App::GitHooks::Config->new(
    file => '...',
);

my $value = $config->get( $section, $name );

Okay so that's the whole vibe: you make a config object, optionally point it at a file, and then you ask it for stuff. Simple. Iconic. Periodt πŸ’…


πŸŽ€ METHODS πŸŽ€

new()

Returns a brand new App::GitHooks::Config object β€” a fresh one, untouched, main character energy ✨

my $config = App::GitHooks::Config->new(
    file => $file,
);

Arguments, bestie:

  • file (optional) β€” a path to a config file that you want loaded up into the object. That's it, that's the whole job πŸ“‚
  • source (optional) β€” this one tells you how the path of the config file to use was figured out. Like, the origin story of your config path πŸ•΅οΈβ™€οΈ

get()

Grabs the value for a given section and key name. Your classic "hey what's the value of this thing" move 🫢

my $value = $config->get( $section, $name );
Heads up! The App::GitHooks configuration files are organized by sections, and the main (default) section is '_'. Yes, literally an underscore. That's the main one. Remember it πŸ’€

get_regex()

Retrieves the specified regex for a given section and key name β€” so basically the same errand as get(), but for regexes 🌈

my $regex = $config->get_regex( $section, $name );

So the tea here: this is very much like get(), except it treats the value as a regex and strips out the outer / symbols, so that whatever comes back is suitable for inclusion in a regex. Which is lowkey the whole point. For example:

my $regex = $config->get_regex( $section, $name );
if ( $variable =~ /$regex/ )
{
    ...
}

See? Slipped right into the match. Chef's kiss 🧚


πŸ’€ BUGS πŸ’€

Please report any bugs or feature requests through the web interface at <https://github.com/guillaumeaubert/App-GitHooks/issues/new>.

Not me asking you to file issues β€” but fr fr, the author will be notified, and then you'll automatically be notified of progress on your bug as changes get made. Mutual notif situation. We love a feedback loop πŸ”₯


πŸ’œ SUPPORT πŸ’œ

You can find documentation for this module with the perldoc command:

perldoc App::GitHooks::Config

You can also look for information at:

  • GitHub's request tracker

<https://github.com/guillaumeaubert/App-GitHooks/issues>

  • AnnoCPAN: Annotated CPAN documentation

<http://annocpan.org/dist/app-githooks>

  • CPAN Ratings

<http://cpanratings.perl.org/d/app-githooks>

  • MetaCPAN

<https://metacpan.org/release/App-GitHooks>


πŸ‘‘ AUTHOR πŸ‘‘

Guillaume Aubert <https://metacpan.org/author/AUBERTG>, "aubertg at cpan.org".


Copyright 2013-2017 Guillaume Aubert.

This code is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file for more details.

The caps are not me being dramatic, bestie, that's the actual legal disclaimer. No warranty, no promises, no refunds πŸ™ˆ

Okay that's the whole page! This one came from the perl v5.42.0 docs, dated 2025-07-25, and it lives in the User Contributed Perl Documentation section. Thanks for reading, ily, go configure something πŸ’–βœ¨

πŸ“¦ where this page comes from