Test::...Version(3pm)
π Test::CPAN::Meta::YAML::Version π
okay bestie, so this is a <pink>User Contributed Perl Documentation</pink> page, section 3pm, for a lil module called Test::CPAN::Meta::YAML::Version. it's giving quality control for your CPAN metadata. let's get into it π«Ά
β¨ NAME β¨
Test::CPAN::Meta::YAML::Version β Validate CPAN META data against the specification π
πΈ SYNOPSIS πΈ
use Test::CPAN::Meta::YAML::Version;
that's it. that's the whole vibe. no cap.
π¦ DESCRIPTION π¦
so this module was written to make sure that a META.yml file β the one that ships with a standard distribution uploaded to CPAN β actually meets the specifications that are, and I quote, slowly being introduced to module uploads. the way they get introduced? via ExtUtils::MakeMaker, Module::Build and Module::Install. it's a whole ecosystem, iykyk.
this module is meant to be used together with Test::CPAN::Meta::YAML, but honestly the code is self contained enough that you can access it directly. independent queen π
also, go peek at CPAN::Meta if you want further details of the CPAN Meta Specification. it's the main character of spec docs fr fr.
π ABSTRACT π
Validation of META.yml data against the CPAN Meta Specification. short, sweet, iconic.
π CLASS CONSTRUCTOR π
new( data => $data [, spec => $version] )β the constructor, the birth of your object, literally.
you must pass it a valid data structure. no data structure, no object, periodt.
optionally you may also provide a specification version. that version then gets used to make sure the given data structure meets the respective specification definition. and if you don't provide a version? the module will attempt to deduce the appropriate specification version from the data structure itself. she's self-sufficient like that π
π METHODS π
π« Main Methods π«
parse()β using the given data structure that you passed to the constructor, it attempts to parse and validate according to the appropriate specification definition.
returns 1 if any errors are found, otherwise returns 0. yes bestie, it's inverted from what you'd expect β 1 means bad, 0 means good. iconic of her honestly.
errors()β returns a list of the errors found during parsing. receipts, basically π
π₯ Check Methods π₯
check_map($spec,$data)β checks whether a map (or hash) part of the data structure conforms to the appropriate specification definition.check_list($spec,$data)β checks whether a list (or array) part of the data structure conforms to the appropriate specification definition.
π§ Validator Methods π§
header($self,$key,$value)β validates that the YAML header is valid.
Note: No longer used as we now read the YAML data structure, not the file. she's retired, but we still love her π«Ά
url($self,$key,$value)β validates that a given value is in an acceptable URL format.urlspec($self,$key,$value)β validates that the URL to aMETA.ymlspecification is a known one. no mystery links allowed πstring_or_undef($self,$key,$value)β validates that the value is either a string or an undef value. bit of a catchall function for parts of the data structure that are completely user defined.string($self,$key,$value)β validates that a string exists for the given key.file($self,$key,$value)β validate that a file is passed for the given key. this may be made more thorough in the future. for now it acts like\&string.exversion($self,$key,$value)β validates a list of versions, e.g.'<= 5, >=2, ==3, !=4, >1, <6, 0'. a whole little crowd of versions.version($self,$key,$value)β validates a single version string. versions of the type'5.8.8'and'0.00_00'are both valid. a leading'v'like'v1.2.3'is also valid. versatile queen β¨boolean($self,$key,$value)β validates for a boolean value. currently these values are'1','0','true','false', however the latter 2 may be removed.license($self,$key,$value)β validates that a value is given for the license. returns1if a known license type, or2if a value is given but the license type is not a recommended one. two different flavours of valid, love that for her.resource($self,$key,$value)β validates that the given key is in CamelCase, to indicate a user defined keyword.keyword($self,$key,$value)β validates that key is in an acceptable format for theMETA.ymlspecification, i.e. any in the character class[-_a-z].
for user defined keys, although not explicitly stated in the specifications (v1.0 - v1.4), the convention is to precede the key with a pattern matching qr{\Ax_}i. following this any character from the character class [-_a-zA-Z] can be used. this clarification has been added to v2.0 of the specification. glow-up behavior π
identifier($self,$key,$value)β validates that key is in an acceptable format for theMETA.ymlspecification, for an identifier, i.e. any that matches the regular expressionqr/[a-z][a-z_]/i.module($self,$key,$value)β validates that a given key is in an acceptable module name format, e.g.'Test::CPAN::Meta::YAML::Version'. she's checking for her own name, meta much? πanything($self,$key,$value)β usually reserved for user defined structures, allowing them to be considered valid without a need for a specification definition for the structure. it literally accepts anything. no rules, just vibes π
π BUGS, PATCHES & FIXES π
there are no known bugs at the time of this release. however, if you spot a bug or are experiencing difficulties that are not explained within the POD documentation, please send an email to barbie@cpan.org or submit a bug to the RT system at http://rt.cpan.org/Public/Dist/Display.html?Name=Test-CPAN-Meta-YAML. however, it would help greatly if you are able to pinpoint problems or even supply a patch. do the work bestie, it's appreciated π
fixes are dependent upon their severity and my availability. should a fix not be forthcoming, please feel free to (politely) remind me. politely is doing a lot of heavy lifting in that sentence, note that π
π AUTHOR π
Barbie, <barbie@cpan.org> for Miss Barbell Productions, <http://www.missbarbell.co.uk>
β COPYRIGHT AND LICENSE β
Copyright (C) 2007-2015 Barbie for Miss Barbell Productions
This distribution is free software; you can redistribute it and/or
modify it under the Artistic Licence v2.
and that's the whole page, bestie! π this one came from perl v5.34.0, dated 2022-06-17 β so if you're reading it in the future, hi from the past, she still slays. bye babes πβ¨
π¦ where this page comes from
- debian bookworm: libtest-cpan-meta-yaml-perl 0.25-2 Β· Artistic-2.0
- debian trixie: libtest-cpan-meta-yaml-perl 0.25-2 Β· Artistic-2.0
- ubuntu noble: libtest-cpan-meta-yaml-perl 0.25-2 Β· Artistic-2.0
- ubuntu resolute: libtest-cpan-meta-yaml-perl 0.25-2 Β· Artistic-2.0
- ubuntu stonking: libtest-cpan-meta-yaml-perl 0.25-2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms