Config...:Itself(3pm)

πŸ¦‹ NAME πŸ¦‹

Config::Model::Itself β€” bestie, it's the Model (or schema) editor for Config::Model. That's the whole vibe. πŸ‘‘


⭐ VERSION ⭐

version 2.027 β€” yeah she's been through some things and she's thriving πŸ’…


✨ SYNOPSIS ✨

# Itself constructor returns an object to read or write the data
# structure containing the model to be edited
my $meta_model = Config::Model::Itself -> new( ) ;

# now load the model to be edited
$meta_model -> read_all( ) ;

# For Curses UI prepare a call-back to write model
my $wr_back = sub { $meta_model->write_all(); }

# create Curses user interface
my $dialog = Config::Model::CursesUI-> new (
     store => $wr_back,
) ;

# start Curses dialog to edit the mode
$dialog->start( $meta_model->config_root )  ;

# that's it. When user quits curses interface, Curses will call
# $wr_back sub ref to write the modified model.

Like, look at her go. Construct, read_all( ), hand the Curses UI a callback, boom β€” user edits the model itself, quits, and the callback writes it all back. No cap. πŸ”₯


πŸ’œ DESCRIPTION πŸ’œ

Okay so Config::Itself and its model files? They provide a model of Config:Model β€” which is literally why she's called Itself. She's modeling her own family. Main character energy fr fr. πŸͺž

Let's step back a little, bestie, because this is actually so good. Any configuration data is, in essence, structured data. And a configuration model is a way to describe the structure and relation of all items of a configuration data set.

Here's the iconic part: that configuration model is also expressed as structured data. And this structured data follows a set of rules which are described for humans in Config::Model.

The structure and rules documented in Config::Model are also expressed in a model in the files provided with Config::Model::Itself.

Hence the possibility to verify, modify configuration data provided by Config::Model can also be applied on configuration models. Using the same user interface. Same UI, different target β€” it's giving recursion but make it fashion. πŸ’…

From a Perl point of view, Config::Model::Itself provides a class dedicated to read and write a set of model files.


🌸 Constructor 🌸

πŸŽ€ new ( [ cm_lib_dir => ... ] ) πŸŽ€

Creates a new read/write handler. If no model_object is passed, the required objects are created for you (she's thoughtful like that 🫢). cm_lib_dir specifies where the model files live β€” defaults to ./lib/Config/Model.

cm_lib_dir is either a Path::Tiny object or a string. Either one, she's not picky.

By default, this constructor will create all necessary Config::Model* objects. But if you already have some lying around and you're feeling generous, you can pass already-created objects with the options:

  • config_model β€” a Config::Model object
  • meta_instance β€” a Config::Model::Instance object
  • meta_root β€” a Config::Model::Node object

🧚 Methods 🧚

  • read_all ( [ root_model => ... ], [ force_load => 1 ] ) β€” Loads all the model files contained in model_dir and all its subdirectories. root_model is used to filter the classes read. Use force_load if you are trying to load a model that contains errors (living dangerously, we love that for you 😭). read_all returns a hash ref containing ( class_name => file_name , ...).
  • write_all β€” Will write back the configuration model in the specified directory. The structure of the read directory is respected β€” she keeps the original layout, periodt. πŸ‘‘
  • write_model_plugin( plugin_dir => foo, plugin_name => bar ) β€” Write plugin models in the passed plugin_dir directory (expected to be a Path::Tiny object). The written file path is made of plugin name and class names. E.g. a plugin named bar for class Foo::Bar is written in bar/Foo/Bar.pl file. This file is to be used by augment_config_class '...', class_data )">
  • read_model_plugin( plugin_dir => foo, plugin_name => bar.pl ) β€” This method searches recursively $plugin_dir/$plugin_name and loads all *.pl files found there. Digging through the directories like a little treasure hunter πŸ”βœ¨
  • list_class_element β€” Returns a string listing all the class and elements. Useful for debugging your configuration model. Debugging bestie, we've all been there πŸ™ˆ
  • get_dot_diagram β€” Returns a graphviz dot file that represents the structure of the configuration model:
    • include relations are represented by solid lines
    • Class usage (i.e. config_class_name parameter) is represented by dashed lines. The name of the element is attached to the dashed line.

πŸ’€ BUGS πŸ’€

Test menu entries are created from the content of the application model parameter. Unfortunately, there's no way to build the menu dynamically. So user cme must be restarted to change the menu if the application list is changed. Like… you have to close the app and reopen it. It's giving 2005, but it is what it is. 😭


🌈 CREDITS 🌈

Here's the list of people who helped improve this project:

  • Gregor Herrmann β€” Thanks for the patches ! 🫢✨

πŸ‘€ SEE ALSO πŸ‘€

Config::Model, Config::Model::Node, Path::Tiny

Go read those, bestie, they're the lore. πŸ“š


πŸŽ€ AUTHOR πŸŽ€

Dominique Dumont β€” the icon, the legend πŸ‘‘


This software is Copyright (c) 2007-2026 by Dominique Dumont.

This is free software, licensed under:

The GNU Lesser General Public License, Version 2.1, February 1999

πŸ’– SUPPORT πŸ’–

🌐 Websites 🌐

The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources. (Google it bestie, that's literally allowed 🫢)

  • CPANTS β€” The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution.

<http://cpants.cpanauthors.org/dist/Config-Model-Itself>

  • CPAN Testers β€” The CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions.

<http://www.cpantesters.org/distro/C/Config-Model-Itself>

  • CPAN Testers Matrix β€” The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms.

<http://matrix.cpantesters.org/?dist=Config-Model-Itself>

  • CPAN Testers Dependencies β€” The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution.

<http://deps.cpantesters.org/?module=Config::Model::Itself>

πŸ› Bugs / Feature Requests πŸ›

Please report any bugs or feature requests by email to ddumont, or through the web interface at <https://github.com/dod38fr/config-model-itself/issues>. You will be automatically notified of any progress on the request by the system. Automatic updates? We love a system that texts you back. πŸ’…

πŸ’» Source Code πŸ’»

The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :) β€” yes bestie, contribute, you're literally built for this ✨

<http://github.com/dod38fr/config-model-itself>

git clone git://github.com/dod38fr/config-model-itself.git

and that's the whole page, babe β€” generated with perl v5.40.1, dated 2026-03-10, and yeah it's the Config...:Itself(3pm) manual, love her πŸ’–

πŸ“¦ where this page comes from