Test::F...:Module(3)

πŸ’– NAME πŸ’–

Test::File::ShareDir::Object::Module β€” object-oriented ShareDir creation for modules, and yes bestie that's the whole vibe: you get an object, you make share dirs, you slay ✨

This one lives in section 3, the User Contributed Perl Documentation corner of the manual, so that's where you'll find it πŸŽ€

🌸 VERSION 🌸

version 1.001002 β€” that's the one, no cap πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

Okay so here's the whole thing in action:

use Test::File::ShareDir::Object::Module;

my $dir = Test::File::ShareDir::Object::Module->new(
    root    => "some/path",
    modules => {
        "Hello::Nurse" => "share/HN"
    },
);

$dir->install_all_modules;
$dir->add_to_inc;

Look at that. Immaculate. Build the object, install everything, add it to @INC. Iconic behavior honestly πŸ”₯

πŸ‘‘ METHODS πŸ‘‘

🌈 "module_names"

my @names = $instance->module_names();

Returns the names of all the modules that are listed in the "modules" set. Just the names, bestie β€” the whole roster πŸ’–

🌈 "module_share_target_dir"

my $dir = $instance->module_share_target_dir("Module::Name");

Returns the path where the "ShareDir" is gonna get created for "Module::Name". That's the destination, the final form, the glow-up location ✨

🌈 "module_share_source_dir"

my $dir = $instance->module_share_source_dir("Module::Name");

Returns the path where the "ShareDir" is going to be COPIED FROM for "Module::Name". Note the all-caps COPIED FROM, that's them yelling, not me β€” it's the origin point, the source of truth 🫢

🌈 "install_module"

$instance->install_module("Module::Name");

Installs "Module::Name"'s "ShareDir". That's it. That's the whole method. Get it, girl πŸ’…

🌈 "install_all_modules"

$instance->install_all_modules();

Installs all the "module_names". All of them. Every single one. Group project but you're actually carrying it πŸŽ€

🌈 "add_to_inc"

DEPRECATED: use "register" instead.

⚠️ Okay bestie listen β€” this one is deprecated. It still exists, but the manpage is literally telling you to use "register". Don't be that girl. Use "register" πŸ’€

🌈 "register"

$instance->register();

Adds the "Tempdir" "ShareDir" ( "inc" ) to the global @INC. Yes the real global one. Main character energy, no notes πŸ‘‘

Since 1.001000

🌈 "clear"

$instance->clear();

Removes the "Tempdir" "ShareDir" ( "inc" ) from the global @INC. The cleanup arc. We love a responsible queen 🌸

Since 1.001000

🧚 ATTRIBUTES 🧚

⭐ "inc"

A "Test::File::ShareDir::Object::Inc" object. That's the friend she brings everywhere 🫢

⭐ "modules"

A hash of:

Module::Name => "relative/path"

Module name on one side, relative path on the other. Simple. Clean. Ate πŸ“

⭐ "root"

The origin all paths's are relative to.

( Defaults to "cwd" ) β€” so if you don't say anything, it just assumes where you're standing πŸ™ˆ

πŸ’œ AUTHOR πŸ’œ

Kent Fredric <kentnl@cpan.org>

This software is copyright (c) 2017 by Kent Fredric <kentnl@cpan.org>.

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


And that's the tea, bestie πŸŽ€ generated by perl v5.42.0 on 2017-03-03, filed under Test::File::ShareDir::Object::Module(3) β€” go forth and make share dirs, iykyk πŸ’–βœ¨

πŸ“¦ where this page comes from