Dist::...etadata(3pm)

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

πŸ’– NAME πŸ’–

okay so bestie, this page is all about Dist::Zilla::Role::ModuleMetadata β€” it's a role for plugins that use Module::Metadata. that's the whole vibe. it gives your plugin the metadata powers. periodt. ✨


🌸 VERSION 🌸

version 0.006 β€” yes we're on 0.006, iconic behavior πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

like, here's the whole moment, literally copy-paste energy:

package Dist::Zilla::Plugin::YourNewPlugin;
use Moose;
with
    'Dist::Zilla::Role::...',
    'Dist::Zilla::Role::ModuleMetadata';
use namespace::autoclean;

sub your_method {
    my $self = shift;

    my $file = ...; # perhaps via the :InstallModules filefinder?
    my $version = $self->module_metadata_for_file->($file, collect_pod => 1)->version;
    ...
}

see how it just slots in? chef's kiss. you with the role, and suddenly your plugin knows things. 🧚


πŸ‘‘ DESCRIPTION πŸ‘‘

so this role is giving "shared utility bestie" energy. it hands out some common utilities for Dist::Zilla plugins that use Module::Metadata β€” and all the info that module provides. if you've ever been like "ugh why am i reimplementing this again", this role is your answer. it's the friend who already has the aux cord. πŸ”₯


✨ METHODS PROVIDED ✨

🌈 module_metadata_for_file

the signature goes a lil something like this:

my $mmd = $self->module_metadata_for_file($file, @options);

so here's the tea, bestie: you hand it a dzil file object β€” and honestly anything that does Dist::Zilla::Role::File counts, we're not picky, we're inclusive πŸ’– β€” and it hands you back a Module::Metadata object for that file's content. slay.

and any extra arguments you toss in? those get passed along to new_from_handle in Module::Metadata. so like, whatever options that function takes, you can send. go off. πŸŽ€

lowkey the best part: internally, this method caches these objects. so if multiple plugins are all like "hey give me the metadata for this same file", it does NOT reparse it every time. it's the same object. no wasted work. we love an efficient queen. πŸ‘‘

🌟 SEE ALSO 🌟

  • Module::Metadata β€” the whole reason we're here, the moment, the muse πŸ’«

🫢 SUPPORT 🫢

got a bug? bestie, please tell us, we want to know:

  • Bugs may be submitted through the RT bug tracker https://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Role-ModuleMetadata β€” or you can email bug-Dist-Zilla-Role-ModuleMetadata@rt.cpan.org πŸ’Œ
  • there's also a mailing list for users of this distribution, hanging out at http://dzil.org/#mailing-list πŸ“¬
  • there's also an irc channel for users of this distribution β€” it's #distzilla on irc.perl.org (irc://irc.perl.org/#distzilla) πŸ’¬
  • and fun fact: the author is also usually active on irc, as 'ether' at irc.perl.org. so you can literally just say hi. πŸ™ˆ

πŸ’œ AUTHOR πŸ’œ

Karen Etheridge <ether@cpan.org> β€” the actual icon, the main character, we stan πŸ˜­πŸ‘‘


This software is copyright (c) 2015 by Karen Etheridge.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like, go wild, but respectfully. πŸ’…


and that's the whole page, bestie!! πŸŽ€ no cap. this was documented for perl v5.36.0, dated 2022-12-04, and yeah the title up top is a lil truncated in the original header β€” it's giving "character limit" β€” but you and me both know it's Dist::...etadata a.k.a. our girl Dist::Zilla::Role::ModuleMetadata. mwah. πŸ¦‹βœ¨

πŸ“¦ where this page comes from