.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Test::CPAN::Meta::JSON 3pm" .TH Test::CPAN::Meta::JSON 3pm "2022-10-13" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::CPAN::Meta::JSON \- Validate a META.json file within a CPAN distribution. .SH "SYNOPSIS" .IX Header "SYNOPSIS" There are two forms this module can be used. .PP The first is a standalone test of your distribution's \s-1META\s0.json file: .PP .Vb 4 \& use Test::More; \& eval "use Test::CPAN::Meta::JSON"; \& plan skip_all => "Test::CPAN::Meta::JSON required for testing META.json" if $@; \& meta_json_ok(); .Ve .PP Note that you may provide an optional label/comment/message/etc to the function, or one will be created automatically. .PP The second form allows you to test other \s-1META\s0.json files, or specify a specific version you wish to test against: .PP .Vb 2 \& use Test::More test => 6; \& use Test::CPAN::Meta::JSON; \& \& # specify a file and specification version \& meta_spec_ok(\*(AqMETA.json\*(Aq,\*(Aq1.3\*(Aq,$msg); \& \& # specify the specification version to validate the local META.json \& meta_spec_ok(undef,\*(Aq1.3\*(Aq,$msg); \& \& # specify a file, where the specification version is deduced \& # from the file itself \& meta_spec_ok(\*(AqMETA.json\*(Aq,undef,$msg); .Ve .PP Note that this form requires you to specify the number of tests you will be running in your test script. Also note that each 'meta_spec_ok' is actually 2 tests under the hood. .PP Also note that the version you are testing against, is the version of the \&\s-1META\s0.yml specification, which forms the basis for the contents of a \s-1META\s0.json file. .PP .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module was written to ensure that a \s-1META\s0.json file, provided with a standard distribution uploaded to \s-1CPAN,\s0 meets the specifications that are slowly being introduced to module uploads, via the use of package makers and installers such as ExtUtils::MakeMaker, Module::Build and Module::Install. .PP See CPAN::Meta for further details of the \s-1CPAN\s0 Meta Specification. .SH "ABSTRACT" .IX Header "ABSTRACT" A test module to validate a \s-1CPAN META\s0.json file. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .IP "\(bu" 4 meta_json_ok([$msg]) .Sp Basic \s-1META\s0.json wrapper around meta_spec_ok. .Sp Returns a hash reference to the contents of the parsed \s-1META\s0.json .IP "\(bu" 4 meta_spec_ok($file, \f(CW$version\fR [,$msg]) .Sp Validates the named file against the given specification version. Both \f(CW$file\fR and \f(CW$version\fR can be undefined. .Sp Returns a hash reference to the contents of the given file, after it has been parsed. .SH "TESTING META FILES" .IX Header "TESTING META FILES" There are currently 3 distributions to test \s-1META\s0 files: .PP .Vb 3 \& Test\-CPAN\-Meta \& Test\-CPAN\-Meta\-JSON \& Test\-CPAN\-Meta\-YAML .Ve .PP All three have slightly different requirements and are intended to be used in slightly different environments. .PP Test-CPAN-Meta-YAML requires a \s-1YAML\s0 parser, and currently looks for the \s-1YAML\s0 or YAML::Syck modules. This is the original variant of the 3 and was intended to provide a more complete \s-1YAML\s0 validation of a \s-1META\s0.yml. .PP Test-CPAN-Meta requires the Parse::CPAN::Meta module, which is now part of Perl Core as of perl\-5.10.1. This version is intended to be used by those only wishing to rely on core modules to test their \s-1META\s0.yml files. .PP Test-CPAN-Meta-JSON is the most recent addition to the family, and is specifically aimed at those distributions that use a \s-1META\s0.json Meta file. The distribution requires the \s-1JSON\s0 module to parse the Meta file. .SH "BUGS, PATCHES & FIXES" .IX Header "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 \s-1POD\s0 documentation, please send an email to barbie@cpan.org or submit a bug to the \&\s-1RT\s0 system (http://rt.cpan.org/Public/Dist/Display.html?Name=Test\-CPAN\-Meta\-JSON). However, it would help greatly if you are able to pinpoint problems or even supply a patch. .PP Fixes are dependent upon their severity and my availability. Should a fix not be forthcoming, please feel free to (politely) remind me. .SH "SEE ALSO" .IX Header "SEE ALSO" .Vb 1 \& JSON .Ve .SH "AUTHOR" .IX Header "AUTHOR" Barbie, for Miss Barbell Productions, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" .Vb 1 \& Copyright (C) 2009\-2015 Barbie for Miss Barbell Productions \& \& This distribution is free software; you can redistribute it and/or \& modify it under the Artistic Licence v2. .Ve