GIF89;aGIF89;aGIF89;a
Team Anon Force
https://t.me/Professor6T9x
Professor6T9 Web SheLL
Linux server1.hnhtechsolutions.com 4.18.0-553.78.1.el8_10.x86_64 #1 SMP Tue Oct 7 04:15:13 EDT 2025 x86_64
Apache
198.177.124.167
/
home
/
portfolio
/
public_html
/
private
[ HOME ]
Exec
Submit
perl-CPAN-Meta.zip
PK �2kZ�� Todonu �[��� improve validation/conversion testing of valid/invalid specs move the distmeta struct to $self->{distmeta} or something rather than having it be the entire gits of the CPAN::Meta validate version numbers with version::is_lax use dclone more in converting structures PK �2kZi���; �; history/META-spec-1_2.podnu �[��� =head1 NAME META-spec - Specification for F<META.yml> documents =head1 SYNOPSIS --- #YAML:1.0 name: Module-Build abstract: Build and install Perl modules version: 0.20 author: - Ken Williams <kwilliams@cpan.org> license: perl distribution_type: module requires: Config: 0 Cwd: 0 Data::Dumper: 0 ExtUtils::Install: 0 File::Basename: 0 File::Compare: 0 File::Copy: 0 File::Find: 0 File::Path: 0 File::Spec: 0 IO::File: 0 perl: 5.005_03 recommends: Archive::Tar: 1.00 ExtUtils::Install: 0.3 ExtUtils::ParseXS: 2.02 Pod::Text: 0 YAML: 0.35 build_requires: Test: 0 urls: license: http://dev.perl.org/licenses/ meta-spec: version: 1.2 url: http://module-build.sourceforge.net/META-spec-v1.2.html generated_by: Module::Build version 0.20 =head1 DESCRIPTION This document describes version 1.2 of the F<META.yml> specification. The F<META.yml> file describes important properties of contributed Perl distributions such as the ones found on CPAN. It is typically created by tools like Module::Build, Module::Install, and ExtUtils::MakeMaker. The fields in the F<META.yml> file are meant to be helpful for people maintaining module collections (like CPAN), for people writing installation tools (like CPAN.pm or CPANPLUS), or just for people who want to know some stuff about a distribution before downloading it and starting to install it. I<Note: The latest stable version of this specification can always be found at L<http://module-build.sourceforge.net/META-spec-current.html>, and the latest development version (which may include things that won't make it into the stable version can always be found at L<http://module-build.sourceforge.net/META-spec-blead.html>.> =head1 FORMAT F<META.yml> files are written in the YAML format (see L<http://www.yaml.org/>). See the following links to learn why we chose YAML instead of, say, XML or Data::Dumper: =over 4 =item * Module::Build design plans L<http://nntp.x.perl.org/group/perl.makemaker/406> =item * Not keen on YAML L<http://nntp.x.perl.org/group/perl.module-authors/1353> =item * META Concerns L<http://nntp.x.perl.org/group/perl.module-authors/1385> =back =head1 TERMINOLOGY =over 4 =item distribution This is the primary object described by the F<META.yml> specification. In the context of this document it usually refers to a collection of modules, scripts, and/or documents that are distributed for other developers to use. =item module This refers to a reusable library of code typically contained in a single file. Currently, we primarily talk of perl modules, but this specification should be open enough to apply to other languages as well (ex. python, ruby). =back =head1 VERSION SPECIFICATIONS Some fields require a version specification (ex. L<"requires">, L<"recommends">, L<"build_requires">, etc.). This section details the version specications that are currently supported. If a single version is listed, then that version is considered to be the minimum version supported. If 0 is given as the version number, then any version is supported. Additionally, for more complicated requirements, the specification supports a list of versions, each of which may be optionally preceeded by a relational operator. Supported operators include E<lt> (less than), E<lt>= (less than or equal), E<gt> (greater than), E<gt>= (greater than or equal), == (equal), and != (not equal). If a list is given then it is evaluated from left to right so that any specifications in the list that conflict with a previous specification are overriden by the later. Examples: >= 1.2, != 1.5, < 2.0 Any version from version 1.2 onward, except version 1.5, that also preceeds version 2.0. =head1 HEADER The first line of a F<META.yml> file should be a valid YAML document header like C<"--- #YAML:1.0">. =head1 FIELDS The rest of the F<META.yml> file is one big YAML mapping whose keys are described here. =head2 meta-spec Example: meta-spec: version: 1.2 url: http://module-build.sourceforge.net/META-spec-v1.2.html (Spec 1.1) [required] {URL} This field indicates the location of the version of the META.yml specification used. =head2 name Example: name: Module-Build (Spec 1.0) [required] {string} The name of the distribution which is often created by taking the "main module" in the distribution and changing "::" to "-". Sometimes it's completely different, however, as in the case of the libww-perl distribution (see L<http://search.cpan.org/author/GAAS/libwww-perl/>). =head2 version Example: version: 0.20 (Spec 1.0) [required] {version} The version of the distribution to which the F<META.yml> file refers. =head2 abstract Example: abstract: Build and install Perl modules. (Spec 1.1) [required] {string} A short description of the purpose of the distribution. =head2 author Example: author: - Ken Williams <kwilliams@cpan.org> (Spec 1.1) [required] {list of strings} A YAML sequence indicating the author(s) of the distribution. The prefered form is author-name <email-address>. =head2 license Example: license: perl (Spec 1.0) [required] {string} The license under which this distribution may be used and redistributed. See L<Module::Build> for the list of valid options. =head2 distribution_type Example: distribution_type: module (Spec 1.0) [optional] {string} What kind of stuff is contained in this distribution. Most things on CPAN are C<module>s (which can also mean a collection of modules), but some things are C<script>s. Unfortunately this field is basically meaningless, since many distributions are hybrids of several kinds of things, or some new thing, or subjectively different in focus depending on who's using them. Tools like Module::Build and MakeMaker will likely stop generating this field. =head2 requires Example: requires: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules this distribution requires for proper operation. The keys are the module names, and the values are version specifications as described in L<Module::Build> for the "requires" parameter. =head2 recommends Example: recommends: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules this distribution recommends for enhanced operation. I<ALTERNATIVE: It may be desirable to present to the user which features depend on which modules so they can make an informed decision about which recommended modules to install.> Example: optional_features: - foo: description: Provides the ability to blah. requires: Data::Dumper: 0 File::Find: 1.03 - bar: description: This feature is not available on this platform. excludes_os: MSWin32 I<(Spec 1.1) [optional] {map} A YAML sequence of names for optional features which are made available when its requirements are met. For each feature a description is provided along with any of L<"requires">, L<"build_requires">, L<"conflicts">, L<"requires_packages">, L<"requires_os">, and L<"excludes_os"> which have the same meaning in this subcontext as described elsewhere in this document.> =head2 build_requires Example: build_requires: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules required for building and/or testing of this distribution. These dependencies are not required after the module is installed. =head2 conflicts Example: conflicts: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules that cannot be installed while this distribution is installed. This is a pretty uncommon situation. =head2 dynamic_config Example: dynamic_config: 0 (Spec 1.0) [optional] {boolean} A boolean flag indicating whether a F<Build.PL> or F<Makefile.PL> (or similar) must be executed when building this distribution, or whether it can be built, tested and installed solely from consulting its metadata file. The main reason to set this to a true value if that your module performs some dynamic configuration (asking questions, sensing the environment, etc.) as part of its build/install process. Currently Module::Build doesn't actually do anything with this flag - it's probably going to be up to higher-level tools like CPAN to do something useful with it. It can potentially bring lots of security, packaging, and convenience improvements. If this field is omitted, it defaults to 1 (true). =head2 private I<(Deprecated)> (Spec 1.0) [optional] {map} This field has been renamed to L</"no_index">. See below. =head2 provides Example: provides: Foo::Bar: file: lib/Foo/Bar.pm version: 0.27_02 Foo::Bar::Blah: file: lib/Foo/Bar/Blah.pm Foo::Bar::Baz: file: lib/Foo/Bar/Baz.pm version: 0.3 (Spec 1.1) [optional] {map} A YAML mapping that describes all packages provided by this distribution. This information can be (and, in some cases, is) used by distribution and automation mechanisms like PAUSE, CPAN, and search.cpan.org to build indexes saying in which distribution various packages can be found. When using tools like C<Module::Build> that can generate the C<provides> mapping for your distribution automatically, make sure you examine what it generates to make sure it makes sense - indexers will usually trust the C<provides> field if it's present, rather than scanning through the distribution files themselves to figure out packages and versions. This is a good thing, because it means you can use the C<provides> field to tell the indexers precisely what you want indexed about your distribution, rather than relying on them to essentially guess what you want indexed. =head2 no_index Example: no_index: file: - My/Module.pm dir: - My/Private package: - My::Module::Stuff namespace: - My::Module::Stuff (Spec 1.1) [optional] {map} A YAML mapping that describes any files, directories, packages, and namespaces that are private (i.e. implementation artifacts) that are not of interest to searching and indexing tools. This is useful when no C<provides> field is present. I<(Note: I'm not actually sure who looks at this field, or exactly what they do with it. This spec could be off in some way from actual usage.)> =head3 file (Spec 1.1) [optional] Exclude any listed file(s). =head3 dir (Spec 1.1) [optional] Exclude anything below the listed directory(ies). =head3 package (Spec 1.1) [optional] Exclude the listed package(s). =head3 namespace (Spec 1.1) [optional] Excludes anything below the listed namespace(s), but I<not> the listed namespace(s) its self. =head2 keywords Example: keywords: - make - build - install (Spec 1.1) [optional] {list} A sequence of keywords/phrases that describe this distribution. =head2 resources Example: resources: license: http://dev.perl.org/licenses/ homepage: http://sourceforge.net/projects/module-build bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build MailingList: http://lists.sourceforge.net/lists/listinfo/module-build-general (Spec 1.1) [optional] {map} A mapping of any URL resources related to this distribution. All-lower-case keys, such as C<homepage>, C<license>, and C<bugtracker>, are reserved by this specification, as they have "official" meanings defined here in this specification. If you'd like to add your own "special" entries (like the "MailingList" entry above), use at least one upper-case letter. The current set of official keys is: =over 2 =item homepage The official home of this project on the web. =item license An URL for an official statement of this distribution's license. =item bugtracker An URL for a bug tracker (e.g. Bugzilla or RT queue) for this project. =back =head2 generated_by Example: generated_by: Module::Build version 0.20 (Spec 1.0) [required] {string} Indicates the tool that was used to create this F<META.yml> file. It's good form to include both the name of the tool and its version, but this field is essentially opaque, at least for the moment. If F<META.yml> was generated by hand, it is suggested that the author be specified here. [Note: My F<meta_stats.pl> script which I use to gather statistics regarding F<META.yml> usage prefers the form listed above, i.e. it splits on /\s+version\s+/ taking the first field as the name of the tool that generated the file and the second field as version of that tool. RWS] =head1 SEE ALSO CPAN, L<http://www.cpan.org/> CPAN.pm, L<http://search.cpan.org/author/ANDK/CPAN/> CPANPLUS, L<http://search.cpan.org/author/KANE/CPANPLUS/> Data::Dumper, L<http://search.cpan.org/author/ILYAM/Data-Dumper/> ExtUtils::MakeMaker, L<http://search.cpan.org/author/MSCHWERN/ExtUtils-MakeMaker/> Module::Build, L<http://search.cpan.org/author/KWILLIAMS/Module-Build/> Module::Install, L<http://search.cpan.org/author/KWILLIAMS/Module-Install/> XML, L<http://www.w3.org/XML/> YAML, L<http://www.yaml.org/> =head1 HISTORY =over 4 =item March 14, 2003 (Pi day) =over 2 =item * Created version 1.0 of this document. =back =item May 8, 2003 =over 2 =item * Added the L</"dynamic_config"> field, which was missing from the initial version. =back =item November 13, 2003 =over 2 =item * Added more YAML rationale articles. =item * Fixed existing link to YAML discussion thread to point to new L<http://nntp.x.perl.org/group/> site. =item * Added and deprecated the L<"private"> field. =item * Added L<"abstract">, L<"configure">, L<"requires_packages">, L<"requires_os">, L<"excludes_os">, and L<"no_index"> fields. =item * Bumped version. =back =item November 16, 2003 =over 2 =item * Added L<"generation">, L<"authored_by"> fields. =item * Add alternative proposal to the L<"recommends"> field. =item * Add proposal for a L<"requires_build_tools"> field. =back =item December 9, 2003 =over 2 =item * Added link to latest version of this specification on CPAN. =item * Added section L<"VERSION SPECIFICATIONS">. =item * Chang name from Module::Build::META-spec to CPAN::META::Specification. =item * Add proposal for L<"auto_regenerate"> field. =back =item December 15, 2003 =over 2 =item * Add L<"index"> field as a compliment to L<"no_index"> =item * Add L<"keywords"> field as a means to aid searching distributions. =item * Add L<"TERMINOLOGY"> section to explain certain terms that may be ambiguous. =back =item July 26, 2005 =over 2 =item * Removed a bunch of items (generation, requires_build_tools, requires_packages, configure, requires_os, excludes_os, auto_regenerate) that have never actually been supported, but were more like records of brainstorming. =item * Changed C<authored_by> to C<author>, since that's always been what it's actually called in actual F<META.yml> files. =item * Added the "==" operator to the list of supported version-checking operators. =item * Noted that the C<distribution_type> field is basically meaningless, and shouldn't really be used. =item * Clarified C<dynamic_config> a bit. =back =item August 23, 2005 =over 2 =item * Removed the name C<CPAN::META::Specification>, since that implies a module that doesn't actually exist. =back =back PK �2kZ��x�� � history/META-spec-1_1.htmlnu �[��� <html> <head> <title>Specification for META.yml</title> </head> <body> <h2 align=center>Specification for the META.yml file</h2> <p>This document describes version 1.0 of the META.yml specification.</p> <p> The META.yml file describes important properties of contributed Perl distributions such as the ones found on <a href="http://www.cpan.org">CPAN</a>. It is typically created by tools like <a href="http://search.cpan.org/author/KWILLIAMS/Module-Build/">Module::Build</a> and <a href="http://search.cpan.org/author/MSCHWERN/ExtUtils-MakeMaker/">ExtUtils::MakeMaker</a>. </p> <p> The fields in the META.yml file are meant to be helpful to people maintaining module collections (like CPAN), for people writing installation tools (like <a href="http://search.cpan.org/author/ANDK/CPAN/">CPAN.pm</a> or <a href="http://search.cpan.org/author/KANE/CPANPLUS/">CPANPLUS</a>), or just people who want to know some stuff about a distribution before downloading it and starting to install it. </p> <h3>Format</h3> <p> META.yml files are written in the <a href="http://www.yaml.org/">YAML</a> format. The reasons we chose YAML instead of, say, XML or Data::Dumper are discussed in <a href="http://archive.develooper.com/makemaker@perl.org/msg00405.html">this thread</a> on the MakeMaker mailing list. </p> <p> The first line of a META.yml file should be a valid <a href="http://www.yaml.org/spec/#.Document">YAML document header</a> like <nobr><tt>"--- #YAML:1.0"</tt></nobr>. </p> <h3>Fields</h3> <p> The rest of the META.yml file is one big YAML <a href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a>, whose keys are described here. </p> <ul> <li><b>name</b><br> Example: <b>Module-Build</b> <p> The name of the distribution. Often created by taking the "main module" in the distribution and changing "::" to "-". Sometimes it's completely different, however, as in the case of the <a href="http://search.cpan.org/author/GAAS/libwww-perl/">libwww-perl</a> distribution. </p> <li><b>version</b><br> Example: <b>0.16</b> <p> The version of the distribution to which the META.yml file refers. This is a mandatory field. </p> <p> The version is essentially an arbitrary string, but <i>must</i> be only ASCII characters, and <i>strongly should</i> be of the format integer-dot-digit-digit, i.e. <tt>25.57</tt>, optionally followed by underscore-digit-digit, i.e. <tt>25.57_04</tt>. </p> <p> The standard tools that deal with module distribution (PAUSE, CPAN, etc.) form an identifier for each distribution by joining the 'name' and 'version' attributes with a dash (<tt>-</tt>) character. Tools who are prepared to deal with distributions that have no version numbers generally omit the dash as well. </p> <li><b>license</b><br> Example: <b>perl</b> <p> a descriptive term for the licenses ... not authoritative, but must be consistent with licensure statements in the READMEs, documentation, etc. </p> <p> The license under which this distribution may be used and redistributed. See <a href="http://search.cpan.org/author/KWILLIAMS/Module-Build/">Module::Build</a> for the list of valid options. </p> <li><b>license_uri</b><br> <p> This should contain a URI where the exact terms of the license may be found. </p> (change "unrestricted" to "redistributable"?) <li><b>distribution_type</b><br> Example: <b>module</b> <p> What kind of stuff is contained in this distribution. Most things on CPAN are <code>module</code>s (which can also mean a collection of modules), but some things are <code>script</code>s. </p> This field is basically meaningless, and tools (like Module::Build or MakeMaker) will likely stop generating it in the future. <li><b>private</b><br> WTF is going on here? index_ignore: any application that indexes the contents of distributions (PAUSE, search.cpan.org) ought to ignore the items (packages, files, directories, namespace hierarchies). <li><b>requires</b><br> Example:<br> <b> Data::Dumper: 0<br> File::Find: 1.03<br> </b> <p> A YAML <a href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a> indicating the Perl modules this distribution requires for proper operation. The keys are the module names, and the values are version specifications as described in the <a href="http://search.cpan.org/author/KWILLIAMS/Module-Build/lib/Module/Build.pm"> documentation for Module::Build's "requires" parameter</a>. </p> <p><i>Note: the exact nature of the fancy specifications like <nobr><tt>">= 1.2, != 1.5, < 2.0"</tt></nobr> is subject to change. Advance notice will be given here. The simple specifications like <tt>"1.2"</tt> will not change in format.</i> </p> <li><b>recommends</b><br> Example:<br> <b> Data::Dumper: 0<br> File::Find: 1.03<br> </b> <p> A YAML <a href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a> indicating the Perl modules this distribution recommends for enhanced operation. </p> <li><b>build_requires</b><br> Example:<br> <b> Data::Dumper: 0<br> File::Find: 1.03<br> </b> <p> A YAML <a href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a> indicating the Perl modules required for building and/or testing of this distribution. These dependencies are not required after the module is installed. </p> <li><b>conflicts</b><br> Example:<br> <b> Data::Dumper: 0<br> File::Find: 1.03<br> </b> <p> A YAML <a href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a> indicating the Perl modules that cannot be installed while this distribution is installed. This is a pretty uncommon situation. </p> - possibly separate out test-time prereqs, complications include: can tests be meaningfully preserved for later running? are test-time prereqs in addition to build-time, or exclusive? - make official location for installed *distributions*, which can contain tests, etc. <li><b>dynamic_config</b><br> Example: <b>0</b> <p> A boolean flag indicating whether a <tt>Build.PL</tt> or <tt>Makefile.PL</tt> (or similar) must be executed, or whether this module can be built, tested and installed solely from consulting its metadata file. The main reason to set this to a true value if that your module performs some dynamic configuration (asking questions, sensing the environment, etc.) as part of its build/install process. </p> <p> Currently <tt>Module::Build</tt> doesn't actually do anything with this flag - it's probably going to be up to higher-level tools like <tt>CPAN.pm</tt> to do something useful with it. It can potentially bring lots of security, packaging, and convenience improvements. </p> <li><b>generated_by</b><br> Example: <b>Module::Build version 0.16</b> <p> Indicates the tool that was used to create this META.yml file. It's good form to include both the name of the tool and its version, but this field is essentially opaque, at least for the moment. </p> * Ingy's suggestions short_description: (add as field, containing abstract, maximum 80 characters, suggested minimum 40 characters) description: (long version of abstract, should add?) maturity: alpha, beta, gamma, mature, stable author_id, owner_id: categorization, keyword, chapter_id: URL for further information: (could default to search.cpan.org on PAUSE) namespaces: can be specified for single elements by prepending dotted-form, i.e. "com.example.my_application.my_property". Default namespace for META.yml is probably "org.cpan.meta_author" or something. Precedent for this is Apple's Carbon namespaces, I think. </ul> <h3>History</h3> <ul> <li><b>March 14, 2003</b> (Pi day) - created version 1.0 of this document.</li> <li><b>May 8, 2003</b> - added the "dynamic_config" field, which was missing from the initial version.</li> </ul> </body> </html> PK �2kZ���� � history/META-spec-1_0.htmlnu �[��� <html> <head> <title>Specification for META.yml</title> </head> <body> <h2 align=center>Specification for the META.yml file</h2> <p>This document describes version 1.0 of the META.yml specification.</p> <p> The META.yml file describes important properties of contributed Perl distributions such as the ones found on <a href="http://www.cpan.org">CPAN</a>. It is typically created by tools like <a href="http://search.cpan.org/author/KWILLIAMS/Module-Build/">Module::Build</a> and <a href="http://search.cpan.org/author/MSCHWERN/ExtUtils-MakeMaker/">ExtUtils::MakeMaker</a>. </p> <p> The fields in the META.yml file are meant to be helpful to people maintaining module collections (like CPAN), for people writing installation tools (like <a href="http://search.cpan.org/author/ANDK/CPAN/">CPAN.pm</a> or <a href="http://search.cpan.org/author/KANE/CPANPLUS/">CPANPLUS</a>), or just people who want to know some stuff about a distribution before downloading it and starting to install it. </p> <h3>Format</h3> <p> META.yml files are written in the <a href="http://www.yaml.org/">YAML</a> format. The reasons we chose YAML instead of, say, XML or Data::Dumper are discussed in <a href="http://archive.develooper.com/makemaker@perl.org/msg00405.html">this thread</a> on the MakeMaker mailing list. </p> <p> The first line of a META.yml file should be a valid <a href="http://www.yaml.org/spec/#.Document">YAML document header</a> like <nobr><tt>"--- #YAML:1.0"</tt></nobr>. </p> <h3>Fields</h3> <p> The rest of the META.yml file is one big YAML <a href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a>, whose keys are described here. </p> <ul> <li><b>name</b><br> Example: <b>Module-Build</b> <p> The name of the distribution. Often created by taking the "main module" in the distribution and changing "::" to "-". Sometimes it's completely different, however, as in the case of the <a href="http://search.cpan.org/author/GAAS/libwww-perl/">libwww-perl</a> distribution. </p> <li><b>version</b><br> Example: <b>0.16</b> <p> The version of the distribution to which the META.yml file refers. </p> <li><b>license</b><br> Example: <b>perl</b> <p> The license under which this distribution may be used and redistributed. See <a href="http://search.cpan.org/author/KWILLIAMS/Module-Build/">Module::Build</a> for the list of valid options. </p> <li><b>distribution_type</b><br> Example: <b>module</b> <p> What kind of stuff is contained in this distribution. Most things on CPAN are <code>module</code>s (which can also mean a collection of modules), but some things are <code>script</code>s. </p> <li><b>requires</b><br> Example:<br> <b> Data::Dumper: 0<br> File::Find: 1.03<br> </b> <p> A YAML <a href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a> indicating the Perl modules this distribution requires for proper operation. The keys are the module names, and the values are version specifications as described in the <a href="http://search.cpan.org/author/KWILLIAMS/Module-Build/lib/Module/Build.pm"> documentation for Module::Build's "requires" parameter</a>. </p> <p><i>Note: the exact nature of the fancy specifications like <nobr><tt>">= 1.2, != 1.5, < 2.0"</tt></nobr> is subject to change. Advance notice will be given here. The simple specifications like <tt>"1.2"</tt> will not change in format.</i> </p> <li><b>recommends</b><br> Example:<br> <b> Data::Dumper: 0<br> File::Find: 1.03<br> </b> <p> A YAML <a href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a> indicating the Perl modules this distribution recommends for enhanced operation. </p> <li><b>build_requires</b><br> Example:<br> <b> Data::Dumper: 0<br> File::Find: 1.03<br> </b> <p> A YAML <a href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a> indicating the Perl modules required for building and/or testing of this distribution. These dependencies are not required after the module is installed. </p> <li><b>conflicts</b><br> Example:<br> <b> Data::Dumper: 0<br> File::Find: 1.03<br> </b> <p> A YAML <a href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a> indicating the Perl modules that cannot be installed while this distribution is installed. This is a pretty uncommon situation. </p> <li><b>dynamic_config</b><br> Example: <b>0</b> <p> A boolean flag indicating whether a <tt>Build.PL</tt> or <tt>Makefile.PL</tt> (or similar) must be executed, or whether this module can be built, tested and installed solely from consulting its metadata file. The main reason to set this to a true value if that your module performs some dynamic configuration (asking questions, sensing the environment, etc.) as part of its build/install process. </p> <p> Currently <tt>Module::Build</tt> doesn't actually do anything with this flag - it's probably going to be up to higher-level tools like <tt>CPAN.pm</tt> to do something useful with it. It can potentially bring lots of security, packaging, and convenience improvements. </p> <li><b>generated_by</b><br> Example: <b>Module::Build version 0.16</b> <p> Indicates the tool that was used to create this META.yml file. It's good form to include both the name of the tool and its version, but this field is essentially opaque, at least for the moment. </p> </ul> <h3>Related Projects</h3> <dl> <dt>DOAP</dt> <dd>An RDF vocabulary to describe software projects. <a href="http://usefulinc.com/doap">http://usefulinc.com/doap</a>.</dd> </dl> <h3>History</h3> <ul> <li><b>March 14, 2003</b> (Pi day) - created version 1.0 of this document.</li> <li><b>May 8, 2003</b> - added the "dynamic_config" field, which was missing from the initial version.</li> </ul> </body> </html> PK �2kZ�V�JG JG history/META-spec-1_4.podnu �[��� =head1 NAME META-spec - Specification for F<META.yml> documents =head1 SYNOPSIS --- #YAML:1.0 name: Module-Build abstract: Build and install Perl modules version: 0.20 author: - Ken Williams <kwilliams@cpan.org> license: perl distribution_type: module requires: Config: 0 Cwd: 0 Data::Dumper: 0 ExtUtils::Install: 0 File::Basename: 0 File::Compare: 0 File::Copy: 0 File::Find: 0 File::Path: 0 File::Spec: 0 IO::File: 0 perl: 5.005_03 recommends: Archive::Tar: 1.00 ExtUtils::Install: 0.3 ExtUtils::ParseXS: 2.02 Pod::Text: 0 YAML: 0.35 build_requires: Test: 0 resources: license: http://dev.perl.org/licenses/ meta-spec: version: 1.4 url: http://module-build.sourceforge.net/META-spec-v1.3.html generated_by: Module::Build version 0.20 =head1 DESCRIPTION This document describes version 1.4 of the F<META.yml> specification. The F<META.yml> file describes important properties of contributed Perl distributions such as the ones found on CPAN. It is typically created by tools like Module::Build, Module::Install, and ExtUtils::MakeMaker. The fields in the F<META.yml> file are meant to be helpful for people maintaining module collections (like CPAN), for people writing installation tools (like CPAN.pm or CPANPLUS), or just for people who want to know some stuff about a distribution before downloading it and starting to install it. I<Note: The latest stable version of this specification can always be found at L<http://module-build.sourceforge.net/META-spec-current.html>, and the latest development version (which may include things that won't make it into the stable version) can always be found at L<http://module-build.sourceforge.net/META-spec-blead.html>.> =begin MAINTAINER The master source for the META spec is META-spec.pod. META-spec.html is built (manually) from META-spec.pod whenever there are changes, and the two files should generally be checked in together. Ideally it would happen through a trigger or something, but it doesn't. Ken has a cron job that copies the latest bleeding-edge version of the spec (HTML version) to Sourceforge whenever his laptop is turned on: 21 * * * * svn cat http://svn.perl.org/modules/Module-Build/trunk/website/META-spec.html \ | ssh kwilliams@shell.sourceforge.net \ 'cat > /home/groups/m/mo/module-build/htdocs/META-spec-blead.html' The numbered revisions of the spec at L<"http://module-build.sourceforge.net/"> are captures of the spec at opportune moments. A couple of symlinks also exist for convenience: -rw-r--r-- 1 kwilliams 24585 Oct 10 17:21 META-spec-blead.html lrwxrwxrwx 1 kwilliams 19 Jan 19 2007 META-spec-current.html -> META-spec-v1.3.html lrwxrwxrwx 1 kwilliams 22 Jan 19 2007 META-spec.html -> META-spec-current.html -rw-r--r-- 1 kwilliams 5830 Jul 25 2005 META-spec-v1.0.html -rw-r--r-- 1 kwilliams 7847 Jul 25 2005 META-spec-v1.1.html -rw-r--r-- 1 kwilliams 22635 Aug 23 2005 META-spec-v1.2.html -rw-r--r-- 1 kwilliams 24086 Nov 4 2006 META-spec-v1.3.html =end MAINTAINER =head1 FORMAT F<META.yml> files are written in the YAML format (see L<http://www.yaml.org/>). See the following links to learn why we chose YAML instead of, say, XML or Data::Dumper: =over 4 =item Module::Build design plans L<http://nntp.x.perl.org/group/perl.makemaker/406> =item Not keen on YAML L<http://nntp.x.perl.org/group/perl.module-authors/1353> =item META Concerns L<http://nntp.x.perl.org/group/perl.module-authors/1385> =back =head1 TERMINOLOGY =over 4 =item distribution This is the primary object described by the F<META.yml> specification. In the context of this document it usually refers to a collection of modules, scripts, and/or documents that are distributed together for other developers to use. Examples of distributions are C<Class-Container>, C<libwww-perl>, or C<DBI>. =item module This refers to a reusable library of code typically contained in a single file. Currently, we primarily talk of perl modules, but this specification should be open enough to apply to other languages as well (ex. python, ruby). Examples of modules are C<Class::Container>, C<LWP::Simple>, or C<DBD::File>. =back =head1 HEADER The first line of a F<META.yml> file should be a valid YAML document header like C<"--- #YAML:1.0">. =head1 FIELDS The rest of the F<META.yml> file is one big YAML mapping whose keys are described here. =head2 meta-spec Example: meta-spec: version: 1.4 url: http://module-build.sourceforge.net/META-spec-v1.3.html (Spec 1.1) [required] {URL} This field indicates the location of the version of the META.yml specification used. =head2 name Example: name: Module-Build (Spec 1.0) [required] {string} The name of the distribution which is often created by taking the "main module" in the distribution and changing "::" to "-". Sometimes it's completely different, however, as in the case of the libww-perl distribution (see L<http://search.cpan.org/dist/libwww-perl/>). =head2 version Example: version: 0.20 (Spec 1.0) [required] {version} The version of the distribution to which the F<META.yml> file refers. =head2 abstract Example: abstract: Build and install Perl modules. (Spec 1.1) [required] {string} A short description of the purpose of the distribution. =head2 author Example: author: - Ken Williams <kwilliams@cpan.org> (Spec 1.1) [required] {list of strings} A YAML sequence indicating the author(s) of the distribution. The prefered form is author-name <email-address>. =head2 license Example: license: perl (Spec 1.0) [required] {string} The license under which this distribution may be used and redistributed. See L<http://search.cpan.org/dist/Module-Build/lib/Module/Build/API.pod> for the list of valid options. =head2 distribution_type Example: distribution_type: module (Spec 1.0) [optional] {string} What kind of stuff is contained in this distribution. Most things on CPAN are C<module>s (which can also mean a collection of modules), but some things are C<script>s. Unfortunately this field is basically meaningless, since many distributions are hybrids of several kinds of things, or some new thing, or subjectively different in focus depending on who's using them. Tools like Module::Build and MakeMaker will likely stop generating this field. =head2 requires Example: requires: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] {map} A YAML mapping indicating the Perl prerequisites this distribution requires for proper operation. The keys are the names of the prerequisites (module names or 'perl'), and the values are version specifications as described in L<VERSION SPECIFICATIONS>. =head2 recommends Example: recommends: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] {map} A YAML mapping indicating the Perl prerequisites this distribution recommends for enhanced operation. The keys are the names of the prerequisites (module names or 'perl'), and the values are version specifications as described in L<VERSION SPECIFICATIONS>. I<ALTERNATIVE: It may be desirable to present to the user which features depend on which modules so they can make an informed decision about which recommended modules to install.> Example: optional_features: foo: description: Provides the ability to blah. requires: Data::Dumper: 0 File::Find: 1.03 I<(Spec 1.1) [optional] {map} A YAML mapping of names for optional features which are made available when its requirements are met. For each feature a description is provided along with any of L<"requires">, L<"build_requires">, and L<"conflicts">, which have the same meaning in this subcontext as described elsewhere in this document.> =head2 build_requires Example: build_requires: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] {map} A YAML mapping indicating the Perl prerequisites required for building and/or testing of this distribution. The keys are the names of the prerequisites (module names or 'perl'), and the values are version specifications as described in L<VERSION SPECIFICATIONS>. These dependencies are not required after the distribution is installed. =head2 configure_requires Example: configure_requires: Module::Build: 0.2809 Data::Dumper: 0 File::Find: 1.03 (Spec 1.4) [optional] {map} A YAML mapping indicating the Perl prerequisites required before configuring this distribution. The keys are the names of the prerequisites (module names or 'perl'), and the values are version specifications as described in L<VERSION SPECIFICATIONS>. These dependencies are not required after the distribution is installed. =head2 conflicts Example: conflicts: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] {map} A YAML mapping indicating any items that cannot be installed while this distribution is installed. This is a pretty uncommon situation. The keys for C<conflicts> are the item names (module names or 'perl'), and the values are version specifications as described in L<VERSION SPECIFICATIONS>. =head2 dynamic_config Example: dynamic_config: 0 (Spec 1.0) [optional] {boolean} A boolean flag indicating whether a F<Build.PL> or F<Makefile.PL> (or similar) must be executed when building this distribution, or whether it can be built, tested and installed solely from consulting its metadata file. The main reason to set this to a true value is that your module performs some dynamic configuration (asking questions, sensing the environment, etc.) as part of its build/install process. Currently Module::Build doesn't actually do anything with this flag - it's probably going to be up to higher-level tools like CPAN to do something useful with it. It can potentially bring lots of security, packaging, and convenience improvements. If this field is omitted, it defaults to 1 (true). =head2 private I<(Deprecated)> (Spec 1.0) [optional] {map} This field has been renamed to L</"no_index">. See below. =head2 provides Example: provides: Foo::Bar: file: lib/Foo/Bar.pm version: 0.27_02 Foo::Bar::Blah: file: lib/Foo/Bar/Blah.pm Foo::Bar::Baz: file: lib/Foo/Bar/Baz.pm version: 0.3 (Spec 1.1) [optional] {map} A YAML mapping that describes all packages provided by this distribution. This information can be (and, in some cases, is) used by distribution and automation mechanisms like PAUSE, CPAN, and search.cpan.org to build indexes saying in which distribution various packages can be found. When using tools like C<Module::Build> that can generate the C<provides> mapping for your distribution automatically, make sure you examine what it generates to make sure it makes sense - indexers will usually trust the C<provides> field if it's present, rather than scanning through the distribution files themselves to figure out packages and versions. This is a good thing, because it means you can use the C<provides> field to tell the indexers precisely what you want indexed about your distribution, rather than relying on them to essentially guess what you want indexed. =head2 no_index Example: no_index: file: - My/Module.pm directory: - My/Private package: - My::Module::Stuff namespace: - My::Module::Stuff (Spec 1.1) [optional] {map} A YAML mapping that describes any files, directories, packages, and namespaces that are private (i.e. implementation artifacts) that are not of interest to searching and indexing tools. This is useful when no C<provides> field is present. For example, C<search.cpan.org> excludes items listed in C<no_index> when searching for POD, meaning files in these directories will not converted to HTML and made public - which is useful if you have example or test PODs that you don't want the search engine to go through. =head3 file (Spec 1.1) [optional] Exclude any listed file(s). =head3 directory (Spec 1.1) [optional] Exclude anything below the listed directory(ies). [Note: previous editions of the spec had C<dir> instead of C<directory>, but I think MakeMaker and various users started using C<directory>, so in deference we switched to that.] =head3 package (Spec 1.1) [optional] Exclude the listed package(s). =head3 namespace (Spec 1.1) [optional] Excludes anything below the listed namespace(s), but I<not> the listed namespace(s) its self. =head2 keywords Example: keywords: - make - build - install (Spec 1.1) [optional] {list} A sequence of keywords/phrases that describe this distribution. =head2 resources Example: resources: license: http://dev.perl.org/licenses/ homepage: http://sourceforge.net/projects/module-build bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build repository: http://sourceforge.net/cvs/?group_id=45731 MailingList: http://lists.sourceforge.net/lists/listinfo/module-build-general (Spec 1.1) [optional] {map} A mapping of any URL resources related to this distribution. All-lower-case keys, such as C<homepage>, C<license>, and C<bugtracker>, are reserved by this specification, as they have "official" meanings defined here in this specification. If you'd like to add your own "special" entries (like the "MailingList" entry above), use at least one upper-case letter. The current set of official keys is: =over 2 =item homepage The official home of this project on the web. =item license An URL for an official statement of this distribution's license. =item bugtracker An URL for a bug tracker (e.g. Bugzilla or RT queue) for this project. =back =head2 generated_by Example: generated_by: Module::Build version 0.20 (Spec 1.0) [required] {string} Indicates the tool that was used to create this F<META.yml> file. It's good form to include both the name of the tool and its version, but this field is essentially opaque, at least for the moment. If F<META.yml> was generated by hand, it is suggested that the author be specified here. [Note: My F<meta_stats.pl> script which I use to gather statistics regarding F<META.yml> usage prefers the form listed above, i.e. it splits on /\s+version\s+/ taking the first field as the name of the tool that generated the file and the second field as version of that tool. RWS] =head1 VERSION SPECIFICATIONS Some fields require a version specification (ex. L<"requires">, L<"recommends">, L<"build_requires">, etc.) to indicate the particular versionZ<>(s) of some other module that may be required as a prerequisite. This section details the version specification formats that are currently supported. The simplest format for a version specification is just the version number itself, e.g. C<2.4>. This means that B<at least> version 2.4 must be present. To indicate that B<any> version of a prerequisite is okay, even if the prerequisite doesn't define a version at all, use the version C<0>. You may also use the operators E<lt> (less than), E<lt>= (less than or equal), E<gt> (greater than), E<gt>= (greater than or equal), == (equal), and != (not equal). For example, the specification C<E<lt> 2.0> means that any version of the prerequisite less than 2.0 is suitable. For more complicated situations, version specifications may be AND-ed together using commas. The specification C<E<gt>= 1.2, != 1.5, E<lt> 2.0> indicates a version that must be B<at least> 1.2, B<less than> 2.0, and B<not equal to> 1.5. =head1 SEE ALSO CPAN, L<http://www.cpan.org/> CPAN.pm, L<http://search.cpan.org/dist/CPAN/> CPANPLUS, L<http://search.cpan.org/dist/CPANPLUS/> Data::Dumper, L<http://search.cpan.org/dist/Data-Dumper/> ExtUtils::MakeMaker, L<http://search.cpan.org/dist/ExtUtils-MakeMaker/> Module::Build, L<http://search.cpan.org/dist/Module-Build/> Module::Install, L<http://search.cpan.org/dist/Module-Install/> XML, L<http://www.w3.org/XML/> YAML, L<http://www.yaml.org/> =head1 HISTORY =over 4 =item March 14, 2003 (Pi day) =over 2 =item * Created version 1.0 of this document. =back =item May 8, 2003 =over 2 =item * Added the L</"dynamic_config"> field, which was missing from the initial version. =back =item November 13, 2003 =over 2 =item * Added more YAML rationale articles. =item * Fixed existing link to YAML discussion thread to point to new L<http://nntp.x.perl.org/group/> site. =item * Added and deprecated the L<"private"> field. =item * Added L<"abstract">, L<"configure">, L<"requires_packages">, L<"requires_os">, L<"excludes_os">, and L<"no_index"> fields. =item * Bumped version. =back =item November 16, 2003 =over 2 =item * Added L<"generation">, L<"authored_by"> fields. =item * Add alternative proposal to the L<"recommends"> field. =item * Add proposal for a L<"requires_build_tools"> field. =back =item December 9, 2003 =over 2 =item * Added link to latest version of this specification on CPAN. =item * Added section L<"VERSION SPECIFICATIONS">. =item * Chang name from Module::Build::META-spec to CPAN::META::Specification. =item * Add proposal for L<"auto_regenerate"> field. =back =item December 15, 2003 =over 2 =item * Add L<"index"> field as a compliment to L<"no_index"> =item * Add L<"keywords"> field as a means to aid searching distributions. =item * Add L<"TERMINOLOGY"> section to explain certain terms that may be ambiguous. =back =item July 26, 2005 =over 2 =item * Removed a bunch of items (generation, requires_build_tools, requires_packages, configure, requires_os, excludes_os, auto_regenerate) that have never actually been supported, but were more like records of brainstorming. =item * Changed C<authored_by> to C<author>, since that's always been what it's actually called in actual F<META.yml> files. =item * Added the "==" operator to the list of supported version-checking operators. =item * Noted that the C<distribution_type> field is basically meaningless, and shouldn't really be used. =item * Clarified C<dynamic_config> a bit. =back =item August 23, 2005 =over 2 =item * Removed the name C<CPAN::META::Specification>, since that implies a module that doesn't actually exist. =back =item June 12, 2007 =over 2 =item * Added C<configure_requires>. =back =back PK �2kZ��ΰ? �? history/META-spec-1_3.podnu �[��� =head1 NAME META-spec - Specification for F<META.yml> documents =head1 SYNOPSIS --- #YAML:1.0 name: Module-Build abstract: Build and install Perl modules version: 0.20 author: - Ken Williams <kwilliams@cpan.org> license: perl distribution_type: module requires: Config: 0 Cwd: 0 Data::Dumper: 0 ExtUtils::Install: 0 File::Basename: 0 File::Compare: 0 File::Copy: 0 File::Find: 0 File::Path: 0 File::Spec: 0 IO::File: 0 perl: 5.005_03 recommends: Archive::Tar: 1.00 ExtUtils::Install: 0.3 ExtUtils::ParseXS: 2.02 Pod::Text: 0 YAML: 0.35 build_requires: Test: 0 urls: license: http://dev.perl.org/licenses/ meta-spec: version: 1.3 url: http://module-build.sourceforge.net/META-spec-v1.3.html generated_by: Module::Build version 0.20 =head1 DESCRIPTION This document describes version 1.3 of the F<META.yml> specification. The F<META.yml> file describes important properties of contributed Perl distributions such as the ones found on CPAN. It is typically created by tools like Module::Build, Module::Install, and ExtUtils::MakeMaker. The fields in the F<META.yml> file are meant to be helpful for people maintaining module collections (like CPAN), for people writing installation tools (like CPAN.pm or CPANPLUS), or just for people who want to know some stuff about a distribution before downloading it and starting to install it. I<Note: The latest stable version of this specification can always be found at L<http://module-build.sourceforge.net/META-spec-current.html>, and the latest development version (which may include things that won't make it into the stable version) can always be found at L<http://module-build.sourceforge.net/META-spec-blead.html>.> =head1 FORMAT F<META.yml> files are written in the YAML format (see L<http://www.yaml.org/>). See the following links to learn why we chose YAML instead of, say, XML or Data::Dumper: =over 4 =item Module::Build design plans L<http://nntp.x.perl.org/group/perl.makemaker/406> =item Not keen on YAML L<http://nntp.x.perl.org/group/perl.module-authors/1353> =item META Concerns L<http://nntp.x.perl.org/group/perl.module-authors/1385> =back =head1 TERMINOLOGY =over 4 =item distribution This is the primary object described by the F<META.yml> specification. In the context of this document it usually refers to a collection of modules, scripts, and/or documents that are distributed together for other developers to use. Examples of distributions are C<Class-Container>, C<libwww-perl>, or C<DBI>. =item module This refers to a reusable library of code typically contained in a single file. Currently, we primarily talk of perl modules, but this specification should be open enough to apply to other languages as well (ex. python, ruby). Examples of modules are C<Class::Container>, C<LWP::Simple>, or C<DBD::File>. =back =head1 HEADER The first line of a F<META.yml> file should be a valid YAML document header like C<"--- #YAML:1.0">. =head1 FIELDS The rest of the F<META.yml> file is one big YAML mapping whose keys are described here. =head2 meta-spec Example: meta-spec: version: 1.3 url: http://module-build.sourceforge.net/META-spec-v1.3.html (Spec 1.1) [required] {URL} This field indicates the location of the version of the META.yml specification used. =head2 name Example: name: Module-Build (Spec 1.0) [required] {string} The name of the distribution which is often created by taking the "main module" in the distribution and changing "::" to "-". Sometimes it's completely different, however, as in the case of the libww-perl distribution (see L<http://search.cpan.org/dist/libwww-perl/>). =head2 version Example: version: 0.20 (Spec 1.0) [required] {version} The version of the distribution to which the F<META.yml> file refers. =head2 abstract Example: abstract: Build and install Perl modules. (Spec 1.1) [required] {string} A short description of the purpose of the distribution. =head2 author Example: author: - Ken Williams <kwilliams@cpan.org> (Spec 1.1) [required] {list of strings} A YAML sequence indicating the author(s) of the distribution. The prefered form is author-name <email-address>. =head2 license Example: license: perl (Spec 1.0) [required] {string} The license under which this distribution may be used and redistributed. See L<Module::Build> for the list of valid options. =head2 distribution_type Example: distribution_type: module (Spec 1.0) [optional] {string} What kind of stuff is contained in this distribution. Most things on CPAN are C<module>s (which can also mean a collection of modules), but some things are C<script>s. Unfortunately this field is basically meaningless, since many distributions are hybrids of several kinds of things, or some new thing, or subjectively different in focus depending on who's using them. Tools like Module::Build and MakeMaker will likely stop generating this field. =head2 requires Example: requires: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules this distribution requires for proper operation. The keys are the module names, and the values are version specifications as described in L<VERSION SPECIFICATIONS>. =head2 recommends Example: recommends: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules this distribution recommends for enhanced operation. The keys are the module names, and the values are version specifications as described in L<VERSION SPECIFICATIONS>. I<ALTERNATIVE: It may be desirable to present to the user which features depend on which modules so they can make an informed decision about which recommended modules to install.> Example: optional_features: - foo: description: Provides the ability to blah. requires: Data::Dumper: 0 File::Find: 1.03 - bar: description: This feature is not available on this platform. excludes_os: MSWin32 I<(Spec 1.1) [optional] {map} A YAML sequence of names for optional features which are made available when its requirements are met. For each feature a description is provided along with any of L<"requires">, L<"build_requires">, L<"conflicts">, L<"requires_packages">, L<"requires_os">, and L<"excludes_os"> which have the same meaning in this subcontext as described elsewhere in this document.> =head2 build_requires Example: build_requires: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules required for building and/or testing of this distribution. The keys are the module names, and the values are version specifications as described in L<VERSION SPECIFICATIONS>. These dependencies are not required after the module is installed. =head2 conflicts Example: conflicts: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules that cannot be installed while this distribution is installed. This is a pretty uncommon situation. The keys for C<conflicts> are the module names, and the values are version specifications as described in L<VERSION SPECIFICATIONS>. =head2 dynamic_config Example: dynamic_config: 0 (Spec 1.0) [optional] {boolean} A boolean flag indicating whether a F<Build.PL> or F<Makefile.PL> (or similar) must be executed when building this distribution, or whether it can be built, tested and installed solely from consulting its metadata file. The main reason to set this to a true value is that your module performs some dynamic configuration (asking questions, sensing the environment, etc.) as part of its build/install process. Currently Module::Build doesn't actually do anything with this flag - it's probably going to be up to higher-level tools like CPAN to do something useful with it. It can potentially bring lots of security, packaging, and convenience improvements. If this field is omitted, it defaults to 1 (true). =head2 private I<(Deprecated)> (Spec 1.0) [optional] {map} This field has been renamed to L</"no_index">. See below. =head2 provides Example: provides: Foo::Bar: file: lib/Foo/Bar.pm version: 0.27_02 Foo::Bar::Blah: file: lib/Foo/Bar/Blah.pm Foo::Bar::Baz: file: lib/Foo/Bar/Baz.pm version: 0.3 (Spec 1.1) [optional] {map} A YAML mapping that describes all packages provided by this distribution. This information can be (and, in some cases, is) used by distribution and automation mechanisms like PAUSE, CPAN, and search.cpan.org to build indexes saying in which distribution various packages can be found. When using tools like C<Module::Build> that can generate the C<provides> mapping for your distribution automatically, make sure you examine what it generates to make sure it makes sense - indexers will usually trust the C<provides> field if it's present, rather than scanning through the distribution files themselves to figure out packages and versions. This is a good thing, because it means you can use the C<provides> field to tell the indexers precisely what you want indexed about your distribution, rather than relying on them to essentially guess what you want indexed. =head2 no_index Example: no_index: file: - My/Module.pm directory: - My/Private package: - My::Module::Stuff namespace: - My::Module::Stuff (Spec 1.1) [optional] {map} A YAML mapping that describes any files, directories, packages, and namespaces that are private (i.e. implementation artifacts) that are not of interest to searching and indexing tools. This is useful when no C<provides> field is present. For example, C<search.cpan.org> excludes items listed in C<no_index> when searching for POD, meaning files in these directories will not converted to HTML and made public - which is useful if you have example or test PODs that you don't want the search engine to go through. =head3 file (Spec 1.1) [optional] Exclude any listed file(s). =head3 directory (Spec 1.1) [optional] Exclude anything below the listed directory(ies). [Note: previous editions of the spec had C<dir> instead of C<directory>, but I think MakeMaker and various users started using C<directory>, so in deference we switched to that.] =head3 package (Spec 1.1) [optional] Exclude the listed package(s). =head3 namespace (Spec 1.1) [optional] Excludes anything below the listed namespace(s), but I<not> the listed namespace(s) its self. =head2 keywords Example: keywords: - make - build - install (Spec 1.1) [optional] {list} A sequence of keywords/phrases that describe this distribution. =head2 resources Example: resources: license: http://dev.perl.org/licenses/ homepage: http://sourceforge.net/projects/module-build bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build repository: http://sourceforge.net/cvs/?group_id=45731 MailingList: http://lists.sourceforge.net/lists/listinfo/module-build-general (Spec 1.1) [optional] {map} A mapping of any URL resources related to this distribution. All-lower-case keys, such as C<homepage>, C<license>, and C<bugtracker>, are reserved by this specification, as they have "official" meanings defined here in this specification. If you'd like to add your own "special" entries (like the "MailingList" entry above), use at least one upper-case letter. The current set of official keys is: =over 2 =item homepage The official home of this project on the web. =item license An URL for an official statement of this distribution's license. =item bugtracker An URL for a bug tracker (e.g. Bugzilla or RT queue) for this project. =back =head2 generated_by Example: generated_by: Module::Build version 0.20 (Spec 1.0) [required] {string} Indicates the tool that was used to create this F<META.yml> file. It's good form to include both the name of the tool and its version, but this field is essentially opaque, at least for the moment. If F<META.yml> was generated by hand, it is suggested that the author be specified here. [Note: My F<meta_stats.pl> script which I use to gather statistics regarding F<META.yml> usage prefers the form listed above, i.e. it splits on /\s+version\s+/ taking the first field as the name of the tool that generated the file and the second field as version of that tool. RWS] =head1 VERSION SPECIFICATIONS Some fields require a version specification (ex. L<"requires">, L<"recommends">, L<"build_requires">, etc.) to indicate the particular versionZ<>(s) of some other module that may be required as a prerequisite. This section details the version specification formats that are currently supported. The simplest format for a version specification is just the version number itself, e.g. C<2.4>. This means that B<at least> version 2.4 must be present. To indicate that B<any> version of a prerequisite is okay, even if the prerequisite doesn't define a version at all, use the version C<0>. You may also use the operators E<lt> (less than), E<lt>= (less than or equal), E<gt> (greater than), E<gt>= (greater than or equal), == (equal), and != (not equal). For example, the specification C<E<lt> 2.0> means that any version of the prerequisite less than 2.0 is suitable. For more complicated situations, version specifications may be AND-ed together using commas. The specification C<E<gt>= 1.2, != 1.5, E<lt> 2.0> indicates a version that must be B<at least> 1.2, B<less than> 2.0, and B<not equal to> 1.5. =head1 SEE ALSO CPAN, L<http://www.cpan.org/> CPAN.pm, L<http://search.cpan.org/dist/CPAN/> CPANPLUS, L<http://search.cpan.org/dist/CPANPLUS/> Data::Dumper, L<http://search.cpan.org/dist/Data-Dumper/> ExtUtils::MakeMaker, L<http://search.cpan.org/dist/ExtUtils-MakeMaker/> Module::Build, L<http://search.cpan.org/dist/Module-Build/> Module::Install, L<http://search.cpan.org/dist/Module-Install/> XML, L<http://www.w3.org/XML/> YAML, L<http://www.yaml.org/> =head1 HISTORY =over 4 =item March 14, 2003 (Pi day) =over 2 =item * Created version 1.0 of this document. =back =item May 8, 2003 =over 2 =item * Added the L</"dynamic_config"> field, which was missing from the initial version. =back =item November 13, 2003 =over 2 =item * Added more YAML rationale articles. =item * Fixed existing link to YAML discussion thread to point to new L<http://nntp.x.perl.org/group/> site. =item * Added and deprecated the L<"private"> field. =item * Added L<"abstract">, L<"configure">, L<"requires_packages">, L<"requires_os">, L<"excludes_os">, and L<"no_index"> fields. =item * Bumped version. =back =item November 16, 2003 =over 2 =item * Added L<"generation">, L<"authored_by"> fields. =item * Add alternative proposal to the L<"recommends"> field. =item * Add proposal for a L<"requires_build_tools"> field. =back =item December 9, 2003 =over 2 =item * Added link to latest version of this specification on CPAN. =item * Added section L<"VERSION SPECIFICATIONS">. =item * Chang name from Module::Build::META-spec to CPAN::META::Specification. =item * Add proposal for L<"auto_regenerate"> field. =back =item December 15, 2003 =over 2 =item * Add L<"index"> field as a compliment to L<"no_index"> =item * Add L<"keywords"> field as a means to aid searching distributions. =item * Add L<"TERMINOLOGY"> section to explain certain terms that may be ambiguous. =back =item July 26, 2005 =over 2 =item * Removed a bunch of items (generation, requires_build_tools, requires_packages, configure, requires_os, excludes_os, auto_regenerate) that have never actually been supported, but were more like records of brainstorming. =item * Changed C<authored_by> to C<author>, since that's always been what it's actually called in actual F<META.yml> files. =item * Added the "==" operator to the list of supported version-checking operators. =item * Noted that the C<distribution_type> field is basically meaningless, and shouldn't really be used. =item * Clarified C<dynamic_config> a bit. =back =item August 23, 2005 =over 2 =item * Removed the name C<CPAN::META::Specification>, since that implies a module that doesn't actually exist. =back =back PK �2kZr�I5�. �. READMEnu �[��� NAME CPAN::Meta - the distribution metadata for a CPAN dist VERSION version 2.150010 SYNOPSIS use v5.10; use strict; use warnings; use CPAN::Meta; use Module::Load; my $meta = CPAN::Meta->load_file('META.json'); printf "testing requirements for %s version %s\n", $meta->name, $meta->version; my $prereqs = $meta->effective_prereqs; for my $phase ( qw/configure runtime build test/ ) { say "Requirements for $phase:"; my $reqs = $prereqs->requirements_for($phase, "requires"); for my $module ( sort $reqs->required_modules ) { my $status; if ( eval { load $module unless $module eq 'perl'; 1 } ) { my $version = $module eq 'perl' ? $] : $module->VERSION; $status = $reqs->accepts_module($module, $version) ? "$version ok" : "$version not ok"; } else { $status = "missing" }; say " $module ($status)"; } } DESCRIPTION Software distributions released to the CPAN include a META.json or, for older distributions, META.yml, which describes the distribution, its contents, and the requirements for building and installing the distribution. The data structure stored in the META.json file is described in CPAN::Meta::Spec. CPAN::Meta provides a simple class to represent this distribution metadata (or *distmeta*), along with some helpful methods for interrogating that data. The documentation below is only for the methods of the CPAN::Meta object. For information on the meaning of individual fields, consult the spec. METHODS new my $meta = CPAN::Meta->new($distmeta_struct, \%options); Returns a valid CPAN::Meta object or dies if the supplied metadata hash reference fails to validate. Older-format metadata will be up-converted to version 2 if they validate against the original stated specification. It takes an optional hashref of options. Valid options include: * lazy_validation -- if true, new will attempt to convert the given metadata to version 2 before attempting to validate it. This means than any fixable errors will be handled by CPAN::Meta::Converter before validation. (Note that this might result in invalid optional data being silently dropped.) The default is false. create my $meta = CPAN::Meta->create($distmeta_struct, \%options); This is same as "new()", except that "generated_by" and "meta-spec" fields will be generated if not provided. This means the metadata structure is assumed to otherwise follow the latest CPAN::Meta::Spec. load_file my $meta = CPAN::Meta->load_file($distmeta_file, \%options); Given a pathname to a file containing metadata, this deserializes the file according to its file suffix and constructs a new "CPAN::Meta" object, just like "new()". It will die if the deserialized version fails to validate against its stated specification version. It takes the same options as "new()" but "lazy_validation" defaults to true. load_yaml_string my $meta = CPAN::Meta->load_yaml_string($yaml, \%options); This method returns a new CPAN::Meta object using the first document in the given YAML string. In other respects it is identical to "load_file()". load_json_string my $meta = CPAN::Meta->load_json_string($json, \%options); This method returns a new CPAN::Meta object using the structure represented by the given JSON string. In other respects it is identical to "load_file()". load_string my $meta = CPAN::Meta->load_string($string, \%options); If you don't know if a string contains YAML or JSON, this method will use Parse::CPAN::Meta to guess. In other respects it is identical to "load_file()". save $meta->save($distmeta_file, \%options); Serializes the object as JSON and writes it to the given file. The only valid option is "version", which defaults to '2'. On Perl 5.8.1 or later, the file is saved with UTF-8 encoding. For "version" 2 (or higher), the filename should end in '.json'. JSON::PP is the default JSON backend. Using another JSON backend requires JSON 2.5 or later and you must set the $ENV{PERL_JSON_BACKEND} to a supported alternate backend like JSON::XS. For "version" less than 2, the filename should end in '.yml'. CPAN::Meta::Converter is used to generate an older metadata structure, which is serialized to YAML. CPAN::Meta::YAML is the default YAML backend. You may set the $ENV{PERL_YAML_BACKEND} to a supported alternative backend, though this is not recommended due to subtle incompatibilities between YAML parsers on CPAN. meta_spec_version This method returns the version part of the "meta_spec" entry in the distmeta structure. It is equivalent to: $meta->meta_spec->{version}; effective_prereqs my $prereqs = $meta->effective_prereqs; my $prereqs = $meta->effective_prereqs( \@feature_identifiers ); This method returns a CPAN::Meta::Prereqs object describing all the prereqs for the distribution. If an arrayref of feature identifiers is given, the prereqs for the identified features are merged together with the distribution's core prereqs before the CPAN::Meta::Prereqs object is returned. should_index_file ... if $meta->should_index_file( $filename ); This method returns true if the given file should be indexed. It decides this by checking the "file" and "directory" keys in the "no_index" property of the distmeta structure. Note that neither the version format nor "release_status" are considered. $filename should be given in unix format. should_index_package ... if $meta->should_index_package( $package ); This method returns true if the given package should be indexed. It decides this by checking the "package" and "namespace" keys in the "no_index" property of the distmeta structure. Note that neither the version format nor "release_status" are considered. features my @feature_objects = $meta->features; This method returns a list of CPAN::Meta::Feature objects, one for each optional feature described by the distribution's metadata. feature my $feature_object = $meta->feature( $identifier ); This method returns a CPAN::Meta::Feature object for the optional feature with the given identifier. If no feature with that identifier exists, an exception will be raised. as_struct my $copy = $meta->as_struct( \%options ); This method returns a deep copy of the object's metadata as an unblessed hash reference. It takes an optional hashref of options. If the hashref contains a "version" argument, the copied metadata will be converted to the version of the specification and returned. For example: my $old_spec = $meta->as_struct( {version => "1.4"} ); as_string my $string = $meta->as_string( \%options ); This method returns a serialized copy of the object's metadata as a character string. (The strings are not UTF-8 encoded.) It takes an optional hashref of options. If the hashref contains a "version" argument, the copied metadata will be converted to the version of the specification and returned. For example: my $string = $meta->as_string( {version => "1.4"} ); For "version" greater than or equal to 2, the string will be serialized as JSON. For "version" less than 2, the string will be serialized as YAML. In both cases, the same rules are followed as in the "save()" method for choosing a serialization backend. The serialized structure will include a "x_serialization_backend" entry giving the package and version used to serialize. Any existing key in the given $meta object will be clobbered. STRING DATA The following methods return a single value, which is the value for the corresponding entry in the distmeta structure. Values should be either undef or strings. * abstract * description * dynamic_config * generated_by * name * release_status * version LIST DATA These methods return lists of string values, which might be represented in the distmeta structure as arrayrefs or scalars: * authors * keywords * licenses The "authors" and "licenses" methods may also be called as "author" and "license", respectively, to match the field name in the distmeta structure. MAP DATA These readers return hashrefs of arbitrary unblessed data structures, each described more fully in the specification: * meta_spec * resources * provides * no_index * prereqs * optional_features CUSTOM DATA A list of custom keys are available from the "custom_keys" method and particular keys may be retrieved with the "custom" method. say $meta->custom($_) for $meta->custom_keys; If a custom key refers to a data structure, a deep clone is returned. BUGS Please report any bugs or feature using the CPAN Request Tracker. Bugs can be submitted through the web interface at <http://rt.cpan.org/Dist/Display.html?Queue=CPAN-Meta> When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. SEE ALSO * CPAN::Meta::Converter * CPAN::Meta::Validator SUPPORT Bugs / Feature Requests Please report any bugs or feature requests through the issue tracker at <https://github.com/Perl-Toolchain-Gang/CPAN-Meta/issues>. You will be notified automatically of any progress on your issue. Source Code This is open source software. The code repository is available for public review and contribution under the terms of the license. <https://github.com/Perl-Toolchain-Gang/CPAN-Meta> git clone https://github.com/Perl-Toolchain-Gang/CPAN-Meta.git AUTHORS * David Golden <dagolden@cpan.org> * Ricardo Signes <rjbs@cpan.org> * Adam Kennedy <adamk@cpan.org> CONTRIBUTORS * Ansgar Burchardt <ansgar@cpan.org> * Avar Arnfjord Bjarmason <avar@cpan.org> * Benjamin Noggle <agwind@users.noreply.github.com> * Christopher J. Madsen <cjm@cpan.org> * Chuck Adams <cja987@gmail.com> * Cory G Watson <gphat@cpan.org> * Damyan Ivanov <dam@cpan.org> * David Golden <xdg@xdg.me> * Eric Wilhelm <ewilhelm@cpan.org> * Graham Knop <haarg@haarg.org> * Gregor Hermann <gregoa@debian.org> * Karen Etheridge <ether@cpan.org> * Kenichi Ishigaki <ishigaki@cpan.org> * Kent Fredric <kentfredric@gmail.com> * Ken Williams <kwilliams@cpan.org> * Lars Dieckow <daxim@cpan.org> * Leon Timmermans <leont@cpan.org> * majensen <maj@fortinbras.us> * Mark Fowler <markf@cpan.org> * Matt S Trout <mst@shadowcat.co.uk> * Michael G. Schwern <mschwern@cpan.org> * Mohammad S Anwar <mohammad.anwar@yahoo.com> * mohawk2 <mohawk2@users.noreply.github.com> * moznion <moznion@gmail.com> * Niko Tyni <ntyni@debian.org> * Olaf Alders <olaf@wundersolutions.com> * Olivier Mengué <dolmen@cpan.org> * Randy Sims <randys@thepierianspring.org> * Tomohiro Hosaka <bokutin@bokut.in> COPYRIGHT AND LICENSE This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. PK �2kZː�� � CONTRIBUTING.mkdnnu �[��� ## HOW TO CONTRIBUTE Thank you for considering contributing to this distribution. This file contains instructions that will help you work with the source code. The distribution is managed with Dist::Zilla. This means than many of the usual files you might expect are not in the repository, but are generated at release time, as is much of the documentation. Some generated files are kept in the repository as a convenience (e.g. Makefile.PL or cpanfile). Generally, **you do not need Dist::Zilla to contribute patches**. You do need Dist::Zilla to create a tarball. See below for guidance. ### Getting dependencies If you have App::cpanminus 1.6 or later installed, you can use `cpanm` to satisfy dependencies like this: $ cpanm --installdeps . Otherwise, look for either a `Makefile.PL` or `cpanfile` file for a list of dependencies to satisfy. ### Running tests You can run tests directly using the `prove` tool: $ prove -l $ prove -lv t/some_test_file.t For most of my distributions, `prove` is entirely sufficient for you to test any patches you have. I use `prove` for 99% of my testing during development. ### Code style and tidying Please try to match any existing coding style. If there is a `.perltidyrc` file, please install Perl::Tidy and use perltidy before submitting patches. If there is a `tidyall.ini` file, you can also install Code::TidyAll and run `tidyall` on a file or `tidyall -a` to tidy all files. ### Patching documentation Much of the documentation Pod is generated at release time. Some is generated boilerplate; other documentation is built from pseudo-POD directives in the source like C<=method> or C<=func>. If you would like to submit a documentation edit, please limit yourself to the documentation you see. If you see typos or documentation issues in the generated docs, please email or open a bug ticket instead of patching. ### Installing and using Dist::Zilla Dist::Zilla is a very powerful authoring tool, optimized for maintaining a large number of distributions with a high degree of automation, but it has a large dependency chain, a bit of a learning curve and requires a number of author-specific plugins. To install it from CPAN, I recommend one of the following approaches for the quickest installation: # using CPAN.pm, but bypassing non-functional pod tests $ cpan TAP::Harness::Restricted $ PERL_MM_USE_DEFAULT=1 HARNESS_CLASS=TAP::Harness::Restricted cpan Dist::Zilla # using cpanm, bypassing *all* tests $ cpanm -n Dist::Zilla In either case, it's probably going to take about 10 minutes. Go for a walk, go get a cup of your favorite beverage, take a bathroom break, or whatever. When you get back, Dist::Zilla should be ready for you. Then you need to install any plugins specific to this distribution: $ cpan `dzil authordeps` $ dzil authordeps | cpanm Once installed, here are some dzil commands you might try: $ dzil build $ dzil test $ dzil xtest You can learn more about Dist::Zilla at http://dzil.org/ PK �2kZZdy y t/prereqs-merge.tnu �[��� use strict; use warnings; use Test::More 0.88; use CPAN::Meta::Prereqs; delete $ENV{PERL_YAML_BACKEND}; delete $ENV{PERL_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_DECODER}; my $prereq_struct_1 = { runtime => { requires => { 'Config' => 0, 'Cwd' => 0, 'perl' => '5.005_03', }, recommends => { 'Pod::Text' => 0, 'YAML' => 0.35, }, }, build => { requires => { 'Test' => 0, }, x_type => { 'Config' => 1, }, }, x_phase => { x_type => { 'POSIX' => '1.23', }, }, }; my $prereq_1 = CPAN::Meta::Prereqs->new($prereq_struct_1); isa_ok($prereq_1, 'CPAN::Meta::Prereqs', 'first prereq'); is_deeply($prereq_1->as_string_hash, $prereq_struct_1, '...and it round trips'); my $prereq_struct_2 = { develop => { requires => { 'Dist::Mothra' => '1.230', }, suggests => { 'Blort::Blortex' => '== 10.20', }, }, runtime => { requires => { 'Config' => 1, 'perl' => '< 6', }, }, build => { suggests => { 'Module::Build::Bob' => '20100101', }, }, x_phase => { requires => { 'JSON::PP' => '2.34', }, }, }; my $prereq_2 = CPAN::Meta::Prereqs->new($prereq_struct_2); isa_ok($prereq_2, 'CPAN::Meta::Prereqs', 'second prereq'); is_deeply($prereq_1->as_string_hash, $prereq_struct_1, '...and it round trips'); my $merged = $prereq_1->with_merged_prereqs($prereq_2); my $want = { develop => { requires => { 'Dist::Mothra' => '1.230', }, suggests => { 'Blort::Blortex' => '== 10.20', }, }, runtime => { requires => { 'Config' => 1, 'Cwd' => 0, 'perl' => '>= 5.005_03, < 6', }, recommends => { 'Pod::Text' => 0, 'YAML' => 0.35, }, }, build => { requires => { 'Test' => 0, }, suggests => { 'Module::Build::Bob' => '20100101', }, x_type => { 'Config' => 1, }, }, x_phase => { requires => { 'JSON::PP' => '2.34', }, x_type => { 'POSIX' => '1.23', }, }, }; is_deeply( $merged->as_string_hash, $want, "we get the right result of merging two prereqs", ); is_deeply( $prereq_2->with_merged_prereqs($prereq_1)->as_string_hash, $want, "...and the merge works the same in reverse", ); done_testing; # vim: ts=2 sts=2 sw=2 et : PK �2kZa"�ѯ) �) t/converter.tnu �[��� use strict; use warnings; use Test::More 0.88; use utf8; use CPAN::Meta; use CPAN::Meta::Validator; use CPAN::Meta::Converter; use File::Spec; use File::Basename qw/basename/; use IO::Dir; use Parse::CPAN::Meta; delete $ENV{PERL_YAML_BACKEND}; delete $ENV{PERL_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_DECODER}; # mock file object package File::StringObject; use overload q{""} => sub { ${$_[0]} }, fallback => 1; sub new { my ($class, $file) = @_; bless \$file, $class; } package main; my $data_dir = IO::Dir->new( 't/data-test' ); my @files = sort grep { /^\w/ } $data_dir->read; *_spec_version = \&CPAN::Meta::Converter::_extract_spec_version; #use Data::Dumper; for my $f ( reverse sort @files ) { note ''; my $path = File::Spec->catfile('t','data-test',$f); my $original = Parse::CPAN::Meta->load_file( $path ); ok( $original, "loaded $f" ); my $original_v = _spec_version($original); # UPCONVERSION { my $cmc = CPAN::Meta::Converter->new( $original ); my $converted = $cmc->convert( version => 2 ); is ( _spec_version($converted), 2, "up converted spec version $original_v to spec version 2"); my $cmv = CPAN::Meta::Validator->new( $converted ); ok ( $cmv->is_valid, "up converted META is valid" ) or diag( "ERRORS:\n" . join( "\n", $cmv->errors ) # . "\nMETA:\n" . Dumper($converted) ); } # UPCONVERSION - partial if ( _spec_version( $original ) < 2 ) { my $cmc = CPAN::Meta::Converter->new( $original ); my $converted = $cmc->convert( version => '1.4' ); is ( _spec_version($converted), 1.4, "up converted spec version $original_v to spec version 1.4"); my $cmv = CPAN::Meta::Validator->new( $converted ); ok ( $cmv->is_valid, "up converted META is valid" ) or diag( "ERRORS:\n" . join( "\n", $cmv->errors ) # . "\nMETA:\n" . Dumper($converted) ); } # DOWNCONVERSION - partial if ( _spec_version( $original ) >= 1.2 ) { my $cmc = CPAN::Meta::Converter->new( $original ); my $converted = $cmc->convert( version => '1.2' ); is ( _spec_version($converted), '1.2', "down converted spec version $original_v to spec version 1.2"); my $cmv = CPAN::Meta::Validator->new( $converted ); ok ( $cmv->is_valid, "down converted META is valid" ) or diag( "ERRORS:\n" . join( "\n", $cmv->errors ) # . "\nMETA:\n" . Dumper($converted) ); if (_spec_version( $original ) == 2) { is_deeply( $converted->{build_requires}, { 'Test::More' => '0.88', 'Build::Requires' => '1.1', 'Test::Requires' => '1.2', }, "downconversion from 2 merge test and build requirements", ); } } # DOWNCONVERSION { my $cmc = CPAN::Meta::Converter->new( $original ); my $converted = $cmc->convert( version => '1.0' ); is ( _spec_version($converted), '1.0', "down converted spec version $original_v to spec version 1.0"); my $cmv = CPAN::Meta::Validator->new( $converted ); ok ( $cmv->is_valid, "down converted META is valid" ) or diag( "ERRORS:\n" . join( "\n", $cmv->errors ) # . "\nMETA:\n" . Dumper($converted) ); unless ($original_v eq '1.0') { like ( $converted->{generated_by}, qr(\Q$original->{generated_by}\E, CPAN::Meta::Converter version \S+$), "added converter mark to generated_by", ); } } } # specific test for custom key handling { my $path = File::Spec->catfile('t','data-test','META-1_4.yml'); my $original = Parse::CPAN::Meta->load_file( $path ); ok( $original, "loaded META-1_4.yml" ); my $cmc = CPAN::Meta::Converter->new( $original ); my $up_converted = $cmc->convert( version => 2 ); ok ( $up_converted->{x_whatever} && ! $up_converted->{'x-whatever'}, "up converted 'x-' to 'x_'" ); ok ( $up_converted->{x_whatelse}, "up converted 'x_' as 'x_'" ); ok ( $up_converted->{x_WhatNow} && ! $up_converted->{XWhatNow}, "up converted 'XFoo' to 'x_Foo'" ) or diag join("\n", keys %$up_converted); } # specific test for custom key handling { my $path = File::Spec->catfile('t','data-test','META-2.json'); my $original = Parse::CPAN::Meta->load_file( $path ); ok( $original, "loaded META-2.json" ); my $cmc = CPAN::Meta::Converter->new( $original ); my $down_converted = $cmc->convert( version => 1.4 ); ok ( $down_converted->{x_whatever}, "down converted 'x_' as 'x_'" ); } # specific test for generalization of unclear licenses { my $path = File::Spec->catfile('t','data-test','gpl-1_4.yml'); my $original = Parse::CPAN::Meta->load_file( $path ); ok( $original, "loaded gpl-1_4.yml" ); my $cmc = CPAN::Meta::Converter->new( $original ); my $up_converted = $cmc->convert( version => 2 ); is_deeply ( $up_converted->{license}, [ "open_source" ], "up converted 'gpl' to 'open_source'" ); } # specific test for upconverting resources { my $path = File::Spec->catfile('t','data-test','resources.yml'); my $original = Parse::CPAN::Meta->load_file( $path ); ok( $original, "loaded resources.yml" ); my $cmc = CPAN::Meta::Converter->new( $original ); my $converted = $cmc->convert( version => 2 ); is_deeply( $converted->{resources}, { x_MailingList => 'http://groups.google.com/group/www-mechanize-users', x_Repository => 'http://code.google.com/p/www-mechanize/source', homepage => 'http://code.google.com/p/www-mechanize/', bugtracker => {web => 'http://code.google.com/p/www-mechanize/issues/list',}, license => ['http://dev.perl.org/licenses/'], }, "upconversion of resources" ); } # specific test for round-tripping resources { my $path = File::Spec->catfile('t','data-test','resources.yml'); my $original = Parse::CPAN::Meta->load_file( $path ); ok( $original, "loaded resources.yml" ); my $cmc1 = CPAN::Meta::Converter->new( $original ); my $converted = $cmc1->convert( version => 2 ); my $cmc2 = CPAN::Meta::Converter->new( $converted ); my $roundtrip = $cmc2->convert( version => 1.4 ); is_deeply( $roundtrip->{resources}, $original->{resources}, "round-trip of resources (1.4->2->1.4)" ); } # specific test for object conversion { my $path = File::Spec->catfile('t','data-test','resources.yml'); my $original = Parse::CPAN::Meta->load_file( $path ); ok( $original, "loaded resources.yml" ); $original->{version} = version->new("1.64"); $original->{no_index}{file} = File::StringObject->new(".gitignore"); pass( "replaced some data fields with objects" ); my $cmc = CPAN::Meta::Converter->new( $original ); ok( my $converted = $cmc->convert( version => 2 ), "conversion successful" ); } # specific test for UTF-8 handling { my $path = File::Spec->catfile('t','data-test','unicode.yml'); my $original = CPAN::Meta->load_file( $path ) or die "Couldn't load $path"; ok( $original, "unicode.yml" ); my @authors = $original->authors; like( $authors[0], qr/Williåms/, "Unicode characters preserved in authors" ); } # specific test for version ranges { my @prereq_keys = qw( prereqs requires build_requires configure_requires recommends conflicts ); for my $case ( qw/ 2 1_4 / ) { my $suffix = $case eq 2 ? "$case.json" : "$case.yml"; my $version = $case; $version =~ tr[_][.]; my $path = File::Spec->catfile('t','data-test','version-ranges-' . $suffix); my $original = Parse::CPAN::Meta->load_file( $path ); ok( $original, "loaded " . basename $path ); my $cmc = CPAN::Meta::Converter->new( $original ); my $converted = $cmc->convert( version => $version ); for my $h ( $original, $converted ) { delete $h->{generated_by}; delete $h->{'meta-spec'}{url}; for my $k ( @prereq_keys ) { _normalize_reqs($h->{$k}) if exists $h->{$k}; } } is_deeply( $converted, $original, "version ranges preserved in conversion" ); } } # specific test for version numbers { my $path = File::Spec->catfile('t','data-test','version-not-normal.json'); my $original = Parse::CPAN::Meta->load_file( $path ); ok( $original, "loaded " . basename $path ); my $cmc = CPAN::Meta::Converter->new( $original ); my $converted = $cmc->convert( version => 2 ); is( $converted->{prereqs}{runtime}{requires}{'File::Find'}, "v0.1.0", "normalize v0.1"); is( $converted->{prereqs}{runtime}{requires}{'File::Path'}, "v1.0.0", "normalize v1.0.0"); } # specific test for missing provides version { my $path = File::Spec->catfile('t','data-test','provides-version-missing.json'); my $original = Parse::CPAN::Meta->load_file( $path ); ok( $original, "loaded " . basename $path ); my $cmc = CPAN::Meta::Converter->new( $original ); my $converted = $cmc->convert( version => 2 ); is_deeply( $converted->{provides}{"Foo::Bar"}, { file => "lib/Foo/Bar.pm", version => "0.27_02" }, "Foo::Bar provides correct" ); is_deeply( $converted->{provides}{"Foo::Bar::Blah"}, { file => "lib/Foo/Bar/Blah.pm" }, "Foo::Bar::Blah provides correct" ); is_deeply( $converted->{provides}{"Foo::Bar::Baz"}, { file => "lib/Foo/Bar/Baz.pm", version => "0.3" }, "Foo::Bar provides correct" ); } # CMR standardizes stuff in a way that makes it hard to test original vs final # so we remove spaces and >= to make them compare the same sub _normalize_reqs { my $hr = shift; for my $k ( keys %$hr ) { if (ref $hr->{$k} eq 'HASH') { _normalize_reqs($hr->{$k}); } elsif ( ! ref $hr->{$k} ) { $hr->{$k} =~ s{\s+}{}g; $hr->{$k} =~ s{>=\s*}{}g; } } } # specific test for multiple licenses { my $path = File::Spec->catfile('t','data-test','META-2.json'); my $original = Parse::CPAN::Meta->load_file( $path ); ok( $original, "loaded META-2.json" ); my $cmc = CPAN::Meta::Converter->new( $original ); my $cleaned_up = $cmc->convert( version => "2" ); is_deeply( $cleaned_up->{license}, [ 'perl_5', 'bsd' ], "multiple license preserved (v2)" ); $cleaned_up = $cmc->convert( version => "1.4" ); is( $cleaned_up->{license}, 'open_source', "multiple license converted to open_source (v1.4)" ); } # specific test for preserving release_status on upconversion { my $path = File::Spec->catfile('t','data-test','preserve-release-status.yml'); my $original = Parse::CPAN::Meta->load_file( $path ); ok( $original, "loaded META-2.json" ); my $cmc = CPAN::Meta::Converter->new( $original ); my $cleaned_up = $cmc->convert( version => "2" ); is( $cleaned_up->{release_status}, 'unstable', "release_status preserved" ); } done_testing; # vim: ts=2 sts=2 sw=2 et: PK �2kZ�a6q� � t/optional_feature-merge.tnu �[��� use strict; use warnings; use Test::More; use CPAN::Meta; use CPAN::Meta::Merge; delete $ENV{PERL_YAML_BACKEND}; delete $ENV{PERL_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_DECODER}; my %base = ( abstract => 'This is a test', author => ['A.U. Thor'], generated_by => 'Myself', license => [ 'perl_5' ], resources => { license => [ 'http://dev.perl.org/licenses/' ], }, prereqs => { runtime => { requires => { Foo => '0', }, }, }, dynamic_config => 0, provides => { Baz => { file => 'lib/Baz.pm', }, }, 'meta-spec' => { url => "http://search.cpan.org/perldoc?CPAN::Meta::Spec", version => 2, }, ); my $fragment1 = { 'optional_features' => { 'FeatureName' => { 'description' => 'desc', 'x_default' => 1, 'prereqs' => { 'runtime' => { 'requires' => { 'A' => '0' } } } } } }; my $fragment2 = { 'optional_features' => { 'FeatureName' => { 'description' => 'desc', 'prereqs' => { 'test' => { 'requires' => { 'B' => '0' } } } } } }; my $merger = CPAN::Meta::Merge->new(default_version => "2"); my $meta1 = $merger->merge(\%base, $fragment1); is_deeply( $meta1, { %base, %$fragment1, }, 'merged first optional_feature fragment into base', ); my $meta2 = $merger->merge($meta1, $fragment2); is_deeply( $meta2, { %base, 'optional_features' => { 'FeatureName' => { 'description' => 'desc', 'x_default' => 1, 'prereqs' => { 'runtime' => { 'requires' => { 'A' => '0' } }, 'test' => { 'requires' => { 'B' => '0' } }, } } } }, 'merged second optional_feature fragment into the first', ); my $fragment3 = { 'optional_features' => { 'FeatureName' => { 'description' => 'other desc', 'prereqs' => { 'test' => { 'requires' => { 'B' => '0' } } } } } }; is( eval { $merger->merge($meta1, $fragment3) }, undef, 'Trying to merge optional_features with same feature name and different descriptions gives an exception'); like $@, qr/^Cannot merge two optional_features named 'FeatureName' with different 'description' values/, 'Exception looks right'; my $fragment4 = { 'optional_features' => { 'FeatureName' => { 'description' => 'desc', 'x_default' => 0, 'prereqs' => { 'test' => { 'requires' => { 'B' => '0' } } } } } }; is( eval { $merger->merge($meta1, $fragment4) }, undef, 'Trying to merge optional_features with same feature name and differences in other keys gives an exception'); like $@, qr/^Cannot merge two optional_features named 'FeatureName' with different 'x_default' values/, 'Exception looks right'; my $fragment5 = { 'optional_features' => { 'Another FeatureName' => { 'description' => 'desc', 'prereqs' => { 'test' => { 'requires' => { 'B' => '0' } } } } } }; my $meta5 = $merger->merge($meta1, $fragment5); is_deeply( $meta5, { %base, 'optional_features' => { 'FeatureName' => { 'description' => 'desc', 'x_default' => 1, 'prereqs' => { 'runtime' => { 'requires' => { 'A' => '0' } } }, }, 'Another FeatureName' => { 'description' => 'desc', 'prereqs' => { 'test' => { 'requires' => { 'B' => '0' } } }, } } }, 'can merge optional_features with different names without collisions', ); done_testing; # vim: ts=4 sts=4 sw=4 noet : PK �2kZ)�k�� � t/converter-bad.tnu �[��� use strict; use warnings; use Test::More 0.88; use CPAN::Meta; use CPAN::Meta::Validator; use CPAN::Meta::Converter; use File::Spec; use IO::Dir; use Parse::CPAN::Meta; delete $ENV{PERL_YAML_BACKEND}; delete $ENV{PERL_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_DECODER}; my @data_dirs = qw( t/data-valid t/data-fixable ); my @files = sort map { my $d = $_; map { "$d/$_" } grep { substr($_,0,1) ne '.' } IO::Dir->new($d)->read } @data_dirs; *_spec_version = \&CPAN::Meta::Converter::_extract_spec_version; #use Data::Dumper; for my $f ( reverse sort @files ) { my $path = File::Spec->catfile($f); my $original = Parse::CPAN::Meta->load_file( $path ); ok( $original, "loaded $f" ); my $original_v = _spec_version($original); # UPCONVERSION if ( $original_v lt '2' ) { my $cmc = CPAN::Meta::Converter->new( $original ); my $converted = $cmc->convert( version => 2 ); is ( _spec_version($converted), 2, "up converted spec version $original_v to spec version 2"); my $cmv = CPAN::Meta::Validator->new( $converted ); ok ( $cmv->is_valid, "up converted META is valid" ) or diag( "ERRORS:\n" . join( "\n", $cmv->errors ) # . "\nMETA:\n" . Dumper($converted) ); } # UPCONVERSION - partial if ( $original_v lt '1.4' ) { my $cmc = CPAN::Meta::Converter->new( $original ); my $converted = $cmc->convert( version => '1.4' ); is ( _spec_version($converted), 1.4, "up converted spec version $original_v to spec version 1.4"); my $cmv = CPAN::Meta::Validator->new( $converted ); ok ( $cmv->is_valid, "up converted META is valid" ) or diag( "ERRORS:\n" . join( "\n", $cmv->errors ) # . "\nMETA:\n" . Dumper($converted) ); } # DOWNCONVERSION - partial if ( $original_v gt '1.2' ) { my $cmc = CPAN::Meta::Converter->new( $original ); my $converted = $cmc->convert( version => '1.2' ); is ( _spec_version($converted), '1.2', "down converted spec version $original_v to spec version 1.2"); my $cmv = CPAN::Meta::Validator->new( $converted ); ok ( $cmv->is_valid, "down converted META is valid" ) or diag( "ERRORS:\n" . join( "\n", $cmv->errors ) # . "\nMETA:\n" . Dumper($converted) ); } # DOWNCONVERSION if ( $original_v gt '1.0' ) { my $cmc = CPAN::Meta::Converter->new( $original ); my $converted = $cmc->convert( version => '1.0' ); is ( _spec_version($converted), '1.0', "down converted spec version $original_v to spec version 1.0"); my $cmv = CPAN::Meta::Validator->new( $converted ); ok ( $cmv->is_valid, "down converted META is valid" ) or diag( "ERRORS:\n" . join( "\n", $cmv->errors ) # . "\nMETA:\n" . Dumper($converted) ); } } done_testing; # vim: ts=2 sts=2 sw=2 et : PK �2kZa� � t/prereqs-finalize.tnu �[��� use strict; use warnings; use Test::More 0.88; use CPAN::Meta::Prereqs; delete $ENV{PERL_YAML_BACKEND}; delete $ENV{PERL_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_DECODER}; sub dies_ok (&@) { my ($code, $qr, $comment) = @_; if (eval { $code->(); 1 }) { fail("$comment: did not die"); } else { like($@, $qr, $comment); } } my $prereqs_struct = { runtime => { requires => { 'Config' => '1.234', 'Cwd' => '876.5', 'IO::File' => 0, 'perl' => '5.005_03', }, recommends => { 'Pod::Text' => 0, 'YAML' => '0.35', }, }, build => { requires => { 'Test' => 0, }, } }; my $prereqs = CPAN::Meta::Prereqs->new($prereqs_struct); isa_ok($prereqs, 'CPAN::Meta::Prereqs'); $prereqs->finalize; ok($prereqs->is_finalized, 'cloned obj is not finalized'); is_deeply($prereqs->as_string_hash, $prereqs_struct, '...and still round-trip'); $prereqs->requirements_for(qw(runtime requires))->add_minimum(Cwd => 10); pass('...we can add a minimum if it has no effect'); dies_ok { $prereqs->requirements_for(qw(runtime requires))->add_minimum(Cwd => 1000) } qr{finalized req}, '...but we die if it would alter a finalized prereqs'; $prereqs->requirements_for(qw(develop suggests)); pass('...we can get a V:R object for a previously unconfigured phase'); dies_ok { $prereqs->requirements_for(qw(develop suggests))->add_minimum(Foo => 1) } qr{finalized req}, '...but we die if we try to put anything in it'; my $clone = $prereqs->clone; isa_ok($clone, 'CPAN::Meta::Prereqs', 'cloned prereqs obj'); ok(! $clone->is_finalized, 'cloned obj is not finalized'); is_deeply($clone->as_string_hash, $prereqs_struct, '...it still round-trips'); $clone->requirements_for(qw(runtime requires))->add_minimum(Cwd => 10); pass('...we can add minimum if it has no effect'); $clone->requirements_for(qw(runtime requires))->add_minimum(Cwd => 1000); pass('...or if it has an effect'); $clone->requirements_for(qw(develop suggests)); pass('...we can get a V:R object for a previously unconfigured phase'); $clone->requirements_for(qw(develop suggests))->add_minimum(Foo => 1); pass('...and we can add stuff to it'); done_testing; # vim: ts=2 sts=2 sw=2 et : PK �2kZ`�;y� � t/validator.tnu �[��� use strict; use warnings; use Test::More 0.88; use CPAN::Meta; use CPAN::Meta::Validator; use File::Spec; use IO::Dir; use Parse::CPAN::Meta; delete $ENV{PERL_YAML_BACKEND}; delete $ENV{PERL_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_DECODER}; { my @data_dirs = qw( t/data-test t/data-valid ); my @files = sort map { my $d = $_; map { "$d/$_" } grep { substr($_,0,1) ne '.' } IO::Dir->new($d)->read } @data_dirs; for my $f ( @files ) { my $meta = Parse::CPAN::Meta->load_file( File::Spec->catfile($f) ); my $cmv = CPAN::Meta::Validator->new({%$meta}); ok( $cmv->is_valid, "$f validates" ) or diag( "ERRORS:\n" . join( "\n", $cmv->errors ) ); } } { my @data_dirs = qw( t/data-fail t/data-fixable ); my @files = sort map { my $d = $_; map { "$d/$_" } grep { substr($_,0,1) ne '.' } IO::Dir->new($d)->read } @data_dirs; for my $f ( @files ) { my $meta = Parse::CPAN::Meta->load_file( File::Spec->catfile($f) ); my $cmv = CPAN::Meta::Validator->new({%$meta}); ok( ! $cmv->is_valid, "$f shouldn't validate" ); note 'validation error: ', $_ foreach $cmv->errors; } } done_testing; # vim: ts=2 sts=2 sw=2 et : PK �2kZ��0 0 t/lib/Parse/CPAN/Meta/Test.pmnu �[��� package Parse::CPAN::Meta::Test; use strict; use Test::More (); use Parse::CPAN::Meta; use File::Spec; use vars qw{@ISA @EXPORT}; BEGIN { require Exporter; @ISA = qw{ Exporter }; @EXPORT = qw{ tests yaml_ok yaml_error slurp load_ok test_data_directory }; } sub test_data_directory { return( "corpus" ); } # 22 tests per call to yaml_ok # 4 tests per call to load_ok sub tests { return ( tests => count(@_) ); } sub count { my $yaml_ok = shift || 0; my $load_ok = shift || 0; my $single = shift || 0; my $count = $yaml_ok * 3 + $load_ok * 4 + $single; return $count; } sub yaml_ok { my $string = shift; my $array = shift; my $name = shift || 'unnamed'; # Does the string parse to the structure my $yaml_copy = $string; my @yaml = eval { Parse::CPAN::Meta::Load( $yaml_copy ); }; Test::More::is( $@, '', "$name: Parse::CPAN::Meta parses without error" ); Test::More::is( $yaml_copy, $string, "$name: Parse::CPAN::Meta does not modify the input string" ); SKIP: { Test::More::skip( "Shortcutting after failure", 1 ) if $@; Test::More::is_deeply( \@yaml, $array, "$name: Parse::CPAN::Meta parses correctly" ); } # Return true as a convenience return 1; } sub yaml_error { my $string = shift; my $yaml = eval { Parse::CPAN::Meta::Load( $string ); }; Test::More::like( $@, qr/$_[0]/, "CPAN::Meta::YAML throws expected error" ); } sub slurp { my $file = shift; my $layer = shift; $layer = "" unless defined $layer; local $/ = undef; open my $fh, "<$layer", $file or die "open($file) failed: $!"; my $source = <$fh>; close( $fh ) or die "close($file) failed: $!"; $source; } sub load_ok { my $name = shift; my $file = shift; my $size = shift; my $layer = shift; Test::More::ok( -f $file, "Found $name" ) or Test::More::diag("Searched at '$file'"); Test::More::ok( -r $file, "Can read $name" ); my $content = slurp( $file, $layer ); Test::More::ok( (defined $content and ! ref $content), "Loaded $name" ); Test::More::ok( ($size < length $content), "Content of $name larger than $size bytes" ); return $content; } 1; PK �2kZ�o�&� � t/prereqs.tnu �[��� use strict; use warnings; use Test::More 0.88; use CPAN::Meta::Prereqs; delete $ENV{PERL_YAML_BACKEND}; delete $ENV{PERL_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_DECODER}; my $prereq_struct = { runtime => { requires => { 'Config' => 0, 'Cwd' => 0, 'Data::Dumper' => 0, 'ExtUtils::Install' => 0, 'File::Basename' => 0, 'File::Compare' => 0, 'File::Copy' => 0, 'File::Find' => 0, 'File::Path' => 0, 'File::Spec' => 0, 'IO::File' => 0, 'perl' => '5.005_03', }, recommends => { 'Archive::Tar' => '1.00', 'ExtUtils::Install' => 0.3, 'ExtUtils::ParseXS' => 2.02, 'Pod::Text' => 0, 'YAML' => 0.35, }, }, build => { requires => { 'Test' => 0, }, x_type => { 'Config' => 1, }, }, x_phase => { requires => { 'JSON::PP' => '2.34', }, x_type => { 'POSIX' => '1.23', }, }, }; my $prereq = CPAN::Meta::Prereqs->new($prereq_struct); isa_ok($prereq, 'CPAN::Meta::Prereqs'); is_deeply($prereq->as_string_hash, $prereq_struct, "round-trip okay"); { my $req = $prereq->requirements_for(qw(runtime requires)); my @req_mod = $req->required_modules; ok( (grep { 'Cwd' eq $_ } @req_mod), "we got the runtime requirements", ); ok( (! grep { 'YAML' eq $_ } @req_mod), "...but not the runtime recommendations", ); ok( (! grep { 'Test' eq $_ } @req_mod), "...nor the build requirements", ); } { my $req = $prereq->requirements_for(qw(runtime requires)); my $rec = $prereq->requirements_for(qw(runtime recommends)); my $merged = $req->clone->add_requirements($rec); my @req_mod = $merged->required_modules; ok( (grep { 'Cwd' eq $_ } @req_mod), "we got the runtime requirements", ); ok( (grep { 'YAML' eq $_ } @req_mod), "...and the runtime recommendations", ); ok( (! grep { 'Test' eq $_ } @req_mod), "...but not the build requirements", ); } { my $req = $prereq->requirements_for(qw(runtime suggests)); my @req_mod = $req->required_modules; is(@req_mod, 0, "empty set of runtime/suggests requirements"); } { my $req = $prereq->requirements_for(qw(develop suggests)); my @req_mod = $req->required_modules; is(@req_mod, 0, "empty set of develop/suggests requirements"); } { my $new_prereq = CPAN::Meta::Prereqs->new; $new_prereq ->requirements_for(qw(runtime requires)) ->add_minimum(Foo => '1.000'); $new_prereq ->requirements_for(qw(runtime requires)) ->add_minimum(Bar => '2.976'); $new_prereq ->requirements_for(qw(test requires)) ->add_minimum(Baz => '3.1416'); $new_prereq ->requirements_for(qw(build recommends)) ->add_minimum(Bar => '3.000'); my $expect = { runtime => { requires => { Foo => '1.000', Bar => '2.976' } }, test => { requires => { Baz => '3.1416' } }, build => { recommends => { Bar => '3.000' } }, }; is_deeply( $new_prereq->as_string_hash, $expect, 'we can accumulate new requirements on a prereq object', ); my $merged_requires = { Foo => '1.000', Bar => '2.976', Baz => '3.1416', }; my $merged_all = { Foo => '1.000', Bar => '3.000', Baz => '3.1416', }; is_deeply( $new_prereq->merged_requirements( [qw/runtime test build/], [qw/requires/] )->as_string_hash, $merged_requires, "we can merge requirements for phases/types" ); is_deeply( $new_prereq->merged_requirements->as_string_hash, $merged_all, "default merging is runtime/build/test for requires/recommends" ); } done_testing; # vim: ts=2 sts=2 sw=2 et : PK �2kZ�� � t/00-report-prereqs.ddnu �[��� do { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '6.17', 'perl' => '5.008001' }, 'suggests' => { 'JSON::PP' => '2.27300' } }, 'develop' => { 'recommends' => { 'Perl::Critic::Policy::Lax::ProhibitStringyEval::ExceptForRequire' => '0' }, 'requires' => { 'Dist::Zilla' => '5', 'Dist::Zilla::Plugin::Authority' => '0', 'Dist::Zilla::Plugin::AutoPrereqs' => '0', 'Dist::Zilla::Plugin::BumpVersionAfterRelease' => '0', 'Dist::Zilla::Plugin::CPANFile' => '0', 'Dist::Zilla::Plugin::CheckChangesHasContent' => '0', 'Dist::Zilla::Plugin::CheckMetaResources' => '0', 'Dist::Zilla::Plugin::CheckPrereqsIndexed' => '0', 'Dist::Zilla::Plugin::ConfirmRelease' => '0', 'Dist::Zilla::Plugin::CopyFilesFromBuild::Filtered' => '0', 'Dist::Zilla::Plugin::DualLife' => '0', 'Dist::Zilla::Plugin::Encoding' => '0', 'Dist::Zilla::Plugin::Git::Check' => '0', 'Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch' => '0', 'Dist::Zilla::Plugin::Git::Commit' => '0', 'Dist::Zilla::Plugin::Git::Contributors' => '0', 'Dist::Zilla::Plugin::Git::GatherDir' => '0', 'Dist::Zilla::Plugin::Git::Push' => '0', 'Dist::Zilla::Plugin::Git::Remote::Check' => '0', 'Dist::Zilla::Plugin::Git::Tag' => '0', 'Dist::Zilla::Plugin::GithubMeta' => '0', 'Dist::Zilla::Plugin::InsertCopyright' => '0', 'Dist::Zilla::Plugin::License' => '0', 'Dist::Zilla::Plugin::MakeMaker' => '0', 'Dist::Zilla::Plugin::MakeMaker::Highlander' => '0.003', 'Dist::Zilla::Plugin::Manifest' => '0', 'Dist::Zilla::Plugin::ManifestSkip' => '0', 'Dist::Zilla::Plugin::MetaJSON' => '0', 'Dist::Zilla::Plugin::MetaNoIndex' => '0', 'Dist::Zilla::Plugin::MetaProvides::Package' => '0', 'Dist::Zilla::Plugin::MetaTests' => '0', 'Dist::Zilla::Plugin::MetaYAML' => '0', 'Dist::Zilla::Plugin::MinimumPerl' => '0', 'Dist::Zilla::Plugin::NextRelease' => '0', 'Dist::Zilla::Plugin::OnlyCorePrereqs' => '0.014', 'Dist::Zilla::Plugin::Pod2Readme' => '0', 'Dist::Zilla::Plugin::PodCoverageTests' => '0', 'Dist::Zilla::Plugin::PodSyntaxTests' => '0', 'Dist::Zilla::Plugin::Prereqs' => '0', 'Dist::Zilla::Plugin::Prereqs::AuthorDeps' => '0', 'Dist::Zilla::Plugin::PromptIfStale' => '0', 'Dist::Zilla::Plugin::PruneCruft' => '0', 'Dist::Zilla::Plugin::RewriteVersion' => '0', 'Dist::Zilla::Plugin::RunExtraTests' => '0', 'Dist::Zilla::Plugin::SurgicalPodWeaver' => '0.0021', 'Dist::Zilla::Plugin::Test::Compile' => '0', 'Dist::Zilla::Plugin::Test::Perl::Critic' => '0', 'Dist::Zilla::Plugin::Test::PodSpelling' => '0', 'Dist::Zilla::Plugin::Test::Portability' => '0', 'Dist::Zilla::Plugin::Test::ReportPrereqs' => '0', 'Dist::Zilla::Plugin::Test::Version' => '0', 'Dist::Zilla::Plugin::TestRelease' => '0', 'Dist::Zilla::Plugin::UploadToCPAN' => '0', 'English' => '0', 'File::Spec' => '0', 'File::Temp' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Pod::Coverage::TrustPod' => '0', 'Pod::Weaver::PluginBundle::DAGOLDEN' => '0', 'Pod::Wordlist' => '0', 'Software::License::Perl_5' => '0', 'Test::CPAN::Meta' => '0', 'Test::More' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.08', 'Test::Portability::Files' => '0', 'Test::Spelling' => '0.12', 'Test::Version' => '1', 'blib' => '1.01' } }, 'runtime' => { 'requires' => { 'CPAN::Meta::Requirements' => '2.121', 'CPAN::Meta::YAML' => '0.011', 'Carp' => '0', 'Encode' => '0', 'Exporter' => '0', 'File::Spec' => '0.80', 'JSON::PP' => '2.27300', 'Scalar::Util' => '0', 'perl' => '5.008001', 'strict' => '0', 'version' => '0.88', 'warnings' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'Data::Dumper' => '0', 'ExtUtils::MakeMaker' => '0', 'File::Basename' => '0', 'File::Spec' => '0.80', 'File::Spec::Functions' => '0', 'File::Temp' => '0.20', 'IO::Dir' => '0', 'JSON::PP' => '2.27300', 'Storable' => '0', 'Test::More' => '0.88', 'lib' => '0', 'overload' => '0', 'perl' => '5.008001', 'utf8' => '0', 'vars' => '0' } } }; $x; }PK �2kZ�IQS S ! t/data-valid/scalar-meta-spec.ymlnu �[��� # http://module-build.sourceforge.net/META-spec-new.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# meta-spec: 1.1 name: XML-Writer version: 0.600 abstract: Easily generate well-formed, namespace-aware XML. authored_by: - David Megginson <david@megginson.com> - Ed Avis <ed@membled.com> - Joseph Walton <joe@kafsemo.org> license: perl distribution_type: module installdirs: site build_requires: perl: 5.006_000 recommends: perl: 5.008_001 no_index: package: - XML::Writer::Namespaces dynamic_config: 0 generated_by: Hand PK �2kZ�y�� � t/data-valid/1206545041-META.ymlnu �[��� --- name: PDF-Template version: 0.29_02 author: ~ abstract: PDF::Template license: perl requires: Encode: 0.01 PDF::Writer: 0.05 perl: 5.6.0 build_requires: IO::Scalar: 0.01 Test::More: 0.47 provides: PDF::Template: file: lib/PDF/Template.pm version: 0.29_02 PDF::Template::Base: file: lib/PDF/Template/Base.pm version: ~ PDF::Template::Constants: file: lib/PDF/Template/Constants.pm version: ~ PDF::Template::Container: file: lib/PDF/Template/Container.pm version: ~ PDF::Template::Container::Always: file: lib/PDF/Template/Container/Always.pm version: ~ PDF::Template::Container::Conditional: file: lib/PDF/Template/Container/Conditional.pm version: ~ PDF::Template::Container::Font: file: lib/PDF/Template/Container/Font.pm version: ~ PDF::Template::Container::Footer: file: lib/PDF/Template/Container/Footer.pm version: ~ PDF::Template::Container::Header: file: lib/PDF/Template/Container/Header.pm version: ~ PDF::Template::Container::Loop: file: lib/PDF/Template/Container/Loop.pm version: ~ PDF::Template::Container::Margin: file: lib/PDF/Template/Container/Margin.pm version: ~ PDF::Template::Container::PageDef: file: lib/PDF/Template/Container/PageDef.pm version: ~ PDF::Template::Container::PdfTemplate: file: lib/PDF/Template/Container/PdfTemplate.pm version: ~ PDF::Template::Container::Row: file: lib/PDF/Template/Container/Row.pm version: ~ PDF::Template::Container::Scope: file: lib/PDF/Template/Container/Scope.pm version: ~ PDF::Template::Container::Section: file: lib/PDF/Template/Container/Section.pm version: ~ PDF::Template::Context: file: lib/PDF/Template/Context.pm version: ~ PDF::Template::Element: file: lib/PDF/Template/Element.pm version: ~ PDF::Template::Element::Bookmark: file: lib/PDF/Template/Element/Bookmark.pm version: ~ PDF::Template::Element::Circle: file: lib/PDF/Template/Element/Circle.pm version: ~ PDF::Template::Element::HorizontalRule: file: lib/PDF/Template/Element/HorizontalRule.pm version: ~ PDF::Template::Element::Image: file: lib/PDF/Template/Element/Image.pm version: ~ PDF::Template::Element::Line: file: lib/PDF/Template/Element/Line.pm version: ~ PDF::Template::Element::PageBreak: file: lib/PDF/Template/Element/PageBreak.pm version: ~ PDF::Template::Element::TextBox: file: lib/PDF/Template/Element/TextBox.pm version: ~ PDF::Template::Element::Var: file: lib/PDF/Template/Element/Var.pm version: ~ PDF::Template::Element::Weblink: file: lib/PDF/Template/Element/Weblink.pm version: ~ PDF::Template::Factory: file: lib/PDF/Template/Factory.pm version: ~ PDF::Template::Iterator: file: lib/PDF/Template/Iterator.pm version: ~ PDF::Template::TextObject: file: lib/PDF/Template/TextObject.pm version: ~ generated_by: Module::Build version 0.2701 PK �2kZ�P�xW W t/data-valid/1122575719-META.ymlnu �[��� --- abstract: 'Generate Catalyst application menus' author: - 'David P.C. Wollmann <converter42@gmail.com>' build_requires: ExtUtils::MakeMaker: 6.42 Test::More: 0 configure_requires: ExtUtils::MakeMaker: 6.42 distribution_type: module generated_by: 'Module::Install version 0.87' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: CatalystX-Menu-Tree no_index: directory: - inc - t inc: [] requires: Catalyst::Runtime: 0 MRO::Compat: 0 perl: 5.8.0 resources: license: http://dev.perl.org/licenses/ version: 0.02 PK �2kZ��y)� � t/data-valid/META-1_0.ymlnu �[��� # http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: Template-DBI version: 1.23 PK �2kZ`�m�� � t/data-valid/META-1_1.ymlnu �[��� --- #YAML:1.0 name: Class-Virtual version: 1.23 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.1.html version: 1.1 PK �2kZ�=��f f t/data-valid/META-2.jsonnu �[��� { "X_deep" : { "deep" : "structure" }, "abstract" : "Build and install Perl modules", "author" : [ "Ken Williams <kwilliams@cpan.org>", "Module-Build List <module-build@perl.org>" ], "description" : "Module::Build is a system for building, testing, and installing Perl modules. It is meant to be an alternative to ExtUtils::MakeMaker... blah blah blah", "dynamic_config" : 1, "generated_by" : "Module::Build version 0.36", "keywords" : [ "toolchain", "cpan", "dual-life" ], "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Module-Build", "optional_features" : { "domination" : { "description" : "Take over the world", "prereqs" : { "develop" : { "requires" : { "Genius::Evil" : "1.234" } }, "runtime" : { "requires" : { "Machine::Weather" : "2.0" } } } } }, "prereqs" : { "build" : { "requires" : { "Test::More" : "0" } }, "runtime" : { "recommends" : { "Archive::Tar" : "1.00", "ExtUtils::Install" : "0.3", "ExtUtils::ParseXS" : "2.02", "Pod::Text" : "0", "YAML" : "0.35" }, "requires" : { "Config" : "0", "Cwd" : "0", "Data::Dumper" : "0", "ExtUtils::Install" : "0", "File::Basename" : "0", "File::Compare" : "0", "File::Copy" : "0", "File::Find" : "0", "File::Path" : "0", "File::Spec" : "0", "IO::File" : "0", "perl" : "5.006" } } }, "release_status" : "stable", "resources" : { "license" : [ "http://dev.perl.org/licenses/" ] }, "version" : "0.36", "x_authority" : "cpan:FLORA", "x_serialization_backend" : "JSON::PP version 2.27300" } PK �2kZr:V_� � "