Dist::...etadata(3pm)
π 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 emailbug-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
#distzillaonirc.perl.org(irc://irc.perl.org/#distzilla) π¬ - and fun fact: the author is also usually active on irc, as
'ether'atirc.perl.org. so you can literally just say hi. π
π AUTHOR π
Karen Etheridge <ether@cpan.org> β the actual icon, the main character, we stan ππ
β COPYRIGHT AND LICENCE β
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
- debian bookworm: libdist-zilla-role-modulemetadata-perl 0.006-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdist-zilla-role-modulemetadata-perl 0.006-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdist-zilla-role-modulemetadata-perl 0.006-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdist-zilla-role-modulemetadata-perl 0.006-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdist-zilla-role-modulemetadata-perl 0.006-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms