Dist::...ta::Dir(3pm)

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

πŸ’– Dist::Metadata::Dir β€” bestie edition πŸ’–

okay so this is a page from the User Contributed Perl Documentation, section 3pm, and the module is Dist::Metadata::Dir β€” yeah the header's all squished and abbreviated but it's her, it's our girl. she's literally the directory-flavored sibling of Dist::Metadata and she's here to help you pull dist metadata straight out of a folder. slay. πŸ’…


✨ NAME ✨

Dist::Metadata::Dir β€” the glow-up that lets Dist::Metadata work its magic on a directory. πŸ—‚οΈ


🌸 VERSION 🌸

version 0.927 πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

  my $dm = Dist::Metadata->new(dir => $path_to_dir);

that's it. that's the whole vibe. one line and you're in. 😌


πŸ’œ DESCRIPTION πŸ’œ

so like, this is a subclass of Dist::Metadata::Dist, right? and what it does is unlock the ability to get a dist's metadata out of a directory instead of a tarball or whatever. iconic behavior honestly.

when is this useful, you ask? when you already have a dist that's been extracted into a directory and you're standing there like "okay but what's in you πŸ₯Ί". that's the moment. that's her moment.

lowkey though β€” on its own this thing is probably not very useful. fr fr. you're meant to use it through "new" in Dist::Metadata, like a supporting character with main character energy. don't come for me, it's what the docs say. πŸ™ˆ

πŸŽ€ METHODS πŸŽ€

πŸ’« new

  $dist = Dist::Metadata::Struct->new(dir => $path);

takes exactly one argument: 'dir', and it should be a path to a directory. just one. she's not complicated. ✨

πŸ’« determine_name_and_version

does exactly what it says on the tin, bestie β€” it attempts to parse the name and the version out of the directory name. detective mode. πŸ”

πŸ’« dir

hands you back the "dir" attribute you gave it in the constructor. no thoughts, just vibes, just the dir. 🫢

πŸ’« file_content

gives you the content for the file you asked for. the actual contents. the tea. 🍡

πŸ’« find_files

returns a list of the file names living beneath the directory β€” and heads up, those names are relative to the directory, not absolute. iykyk. πŸ“

πŸ’« physical_directory

returns the "dir" attribute, because β€” plot twist β€” this already is a directory containing the files you want. like, she IS the moment. no conversion needed, no cap. πŸ‘‘


🌈 AUTHOR 🌈

Randy Stauner <rwstauner@cpan.org> β€” thank you for your service, king πŸ«‘πŸ’–


this software is copyright (c) 2011 by Randy Stauner.

it's free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. periodt. πŸ’…


and that's the whole page, bestie!! πŸŽ‰ no notes, she ate. this was generated by perl v5.34.0 on 2022-06-13, so if you're reading this from the future... hi, hope you're hydrated πŸ₯€πŸ’– ✨ bye luv u ✨

πŸ“¦ where this page comes from