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>
π COPYRIGHT AND LICENSE π
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
- opensuse-leap 16.0: perl-Test-File-ShareDir 1.001002-160000.2.2 Β· Artistic-1.0 or GPL-1.0+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms