File::TreeCreate(3pm)

πŸ“¦
version 0.0.1 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– File::TreeCreate πŸ’–

okay bestie, so this is File::TreeCreate β€” the Perl module that recursively creates a whole directory tree for you πŸŽ€ it lives in the User Contributed Perl Documentation section of your manpages, and honestly? it's giving "I was copy-pasted into like five different test suites and finally got my own glow-up" energy. no cap.


✨ VERSION ✨

this is version 0.0.1 πŸ¦‹ tiny number, big dreams.


🌸 SYNOPSIS 🌸

here's the vibe, fr fr β€” you build a nested hash describing your dream tree, then hand it over and let the module do its thing:

use File::TreeCreate ();

my $t = File::TreeCreate->new();

my $tree = {
    'name' => "tree-create--tree-test-1/",
    'subs' => [
        {
            'name'     => "b.doc",
            'contents' => "This file was spotted in the wild.",
        },
        {
            'name' => "a/",
        },
        {
            'name' => "foo/",
            'subs' => [
                {
                    'name' => "yet/",
                },
            ],
        },
    ],
};

$t->create_tree( "./t/sample-data/", $tree );

# TEST
is_deeply(
    $t->ls("./t/sample-data/tree-create--tree-test-1"),
    [ "a", "b.doc", "foo" ],
    "Testing the contents of the root tree"
);

see how it eats? πŸ“ you describe the tree, you create the tree, you check the tree. periodt.


πŸ’œ DESCRIPTION πŸ’œ

okay so the lore: this module was extracted from several near-identical copies that were living in the tests of some of the author's CPAN distributions 😭 like, the same code was just out there duplicating itself in multiple test dirs, so it got pulled out and given main character energy as its own module. iconic behaviour, honestly.


πŸŽ€ METHODS πŸŽ€

πŸ’… $obj->cat($path)

slurp the file. πŸ₯€ (yes, literally β€” it reads the whole thing in.)

πŸ’… $obj->create_tree($unix_init_path, $tree)

create the tree. 🌳 the whole point of the module, the moment we've all been waiting for.

πŸ’… $obj->exist($path)

does the path exist πŸ€” that's it, that's the question.

πŸ’… $obj->get_path($path)

canonicalize the path from UNIX-like. 🧚

πŸ’… $obj->is_dir($path)

is the path a directory. πŸ“

πŸ’… $obj->is_file($path)

is the path a file. πŸ“„

πŸ’… $obj->ls($dir_path)

list files in a directory. πŸ‘€βœ¨

πŸ’… my $obj = File::TreeCreate->new()

instantiates a new object. 🫢 your very own TreeCreate bestie, freshly born.


πŸ¦‹ SUPPORT πŸ¦‹

🌐 Websites

okay so these websites have more info about this module and might genuinely help you out, bestie. and as always β€” in addition to those websites β€” please use your favorite search engine to discover more resources. πŸ”

  • MetaCPAN β€” a modern, open-source CPAN search engine, useful to view POD in HTML format.

<https://metacpan.org/release/File-TreeCreate>

  • RT: CPAN's Bug Tracker β€” the RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN.

<https://rt.cpan.org/Public/Dist/Display.html?Name=File-TreeCreate>

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

<http://cpants.cpanauthors.org/dist/File-TreeCreate>

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

<http://www.cpantesters.org/distro/F/File-TreeCreate>

  • 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=File-TreeCreate>

  • 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=File::TreeCreate>

πŸ› Bugs / Feature Requests

got a bug? got a feature request? spill it πŸ’Œ please report any bugs or feature requests by email to bug-file-treecreate at rt.cpan.org, or through the web interface at <https://rt.cpan.org/Public/Bug/Report.html?Queue=File-TreeCreate>. you will be automatically notified of any progress on the request by the system. love that for you. 🫢

πŸ’» 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 :)

<https://github.com/shlomif/perl-File-TreeCreate>

git clone git://github.com/shlomif/perl-File-TreeCreate.git

πŸ‘‘ AUTHOR πŸ‘‘

Shlomi Fish <shlomif@cpan.org> β€” the icon, the legend. πŸ’œ


πŸ’€ BUGS πŸ’€

please report any bugs or feature requests on the bugtracker website <https://github.com/shlomif/perl-File-TreeCreate/issues>

when submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. πŸ™ like, actually include it β€” future-you will thank you.


this software is Copyright (c) 2021 by Shlomi Fish.

this is free software, licensed under:

The MIT (X11) License

and that's the whole page, bestie!! πŸŽ€ this gem was served up by perl v5.36.0, dated 2022-11-19, and it lives in your manpages as File::TreeCreate(3pm) πŸ¦‹ go build a tree, you've got this πŸ’…βœ¨

πŸ“¦ where this page comes from