1Test::CPAN::Meta::VersiUosne(r3)Contributed Perl DocumenTteastti:o:nCPAN::Meta::Version(3)
2
3
4

NAME

6       Test::CPAN::Meta::Version - Validation of META.yml specification
7       elements.
8

SYNOPSIS

10         use Test::CPAN::Meta::Version;
11

DESCRIPTION

13       This module was written to ensure that a META.yml file, provided with a
14       standard distribution uploaded to CPAN, meets the specifications that
15       are slowly being introduced to module uploads, via the use of
16       ExtUtils::MakeMaker, Module::Build and Module::Install.
17
18       This module is meant to be used together with Test::CPAN::Meta, however
19       the code is self contained enough that you can access it directly.
20

ABSTRACT

22       Validation of META.yml specification elements.
23

CLASS CONSTRUCTOR

25       ·   new( yaml => $yaml [, spec => $version] )
26
27           The constructor must be passed a valid YAML data structure.
28
29           Optionally you may also provide a specification version. This
30           version is then use to ensure that the given YAML data structure
31           meets the respective specification definition. If no version is
32           provided the module will attempt to deduce the appropriate
33           specification version from the data structure itself.
34

METHODS

36   Main Methods
37       ·   parse()
38
39           Using the YAML data structure provided with the constructure,
40           attempts to parse and validate according to the appropriate
41           specification definition.
42
43           Returns 1 if any errors found, otherwise returns 0.
44
45       ·   errors()
46
47           Returns a list of the errors found during parsing.
48
49   Check Methods
50       ·   check_map($spec,$data)
51
52           Checks whether a map (or hash) part of the YAML data structure
53           conforms to the appropriate specification definition.
54
55       ·   check_list($spec,$data)
56
57           Checks whether a list (or array) part of the YAML data structure
58           conforms to the appropriate specification definition.
59
60   Validator Methods
61       ·   header($self,$key,$value)
62
63           Validates that the YAML header is valid.
64
65           Note: No longer used as we now read the YAML data structure, not
66           the file.
67
68       ·   url($self,$key,$value)
69
70           Validates that a given value is in an acceptable URL format
71
72       ·   urlspec($self,$key,$value)
73
74           Validates that the URL to a META.yml specification is a known one.
75
76       ·   string_or_undef($self,$key,$value)
77
78           Validates that the value is either a string or an undef value. Bit
79           of a catchall function for parts of the data structure that are
80           completely user defined.
81
82       ·   string($self,$key,$value)
83
84           Validates that a string exists for the given key.
85
86       ·   file($self,$key,$value)
87
88           Validate that a file is passed for the given key. This may be made
89           more thorough in the future. For now it acts like \&string.
90
91       ·   exversion($self,$key,$value)
92
93           Validates a list of versions, e.g. '<= 5, >=2, ==3, !=4, >1, <6,
94           0'.
95
96       ·   version($self,$key,$value)
97
98           Validates a single version string. Versions of the type '5.8.8' and
99           '0.00_00' are both valid. A leading 'v' like 'v1.2.3' is also
100           valid.
101
102       ·   boolean($self,$key,$value)
103
104           Validates for a boolean value. Currently these values are '1', '0',
105           'true', 'false', however the latter 2 may be removed.
106
107       ·   license($self,$key,$value)
108
109           Validates that a value is given for the license. Returns 1 if an
110           known license type, or 2 if a value is given but the license type
111           is not a recommended one.
112
113       ·   resource($self,$key,$value)
114
115           Validates that the given key is in CamelCase, to indicate a user
116           defined keyword.
117
118       ·   word($self,$key,$value)
119
120           Validates that key is in an acceptable format for the META.yml
121           specification, i.e. any in the character class [-_a-z].
122
123       ·   module($self,$key,$value)
124
125           Validates that a given key is in an acceptable module name format,
126           e.g.  'Test::CPAN::Meta::Version'.
127

BUGS, PATCHES & FIXES

129       There are no known bugs at the time of this release. However, if you
130       spot a bug or are experiencing difficulties that are not explained
131       within the POD documentation, please send an email to barbie@cpan.org
132       or submit a bug to the RT system
133       (http://rt.cpan.org/Public/Dist/Display.html?Name=Test-CPAN-Meta).
134       However, it would help greatly if you are able to pinpoint problems or
135       even supply a patch.
136
137       Fixes are dependant upon their severity and my availablity. Should a
138       fix not be forthcoming, please feel free to (politely) remind me.
139

DSLIP

141         b - Beta testing
142         d - Developer
143         p - Perl-only
144         O - Object oriented
145         p - Standard-Perl: user may choose between GPL and Artistic
146

AUTHOR

148       Barbie, <barbie@cpan.org> for Miss Barbell Productions,
149       <http://www.missbarbell.co.uk>
150
152         Copyright (C) 2007,2008 Barbie for Miss Barbell Productions
153
154         This module is free software; you can redistribute it and/or
155         modify it under the same terms as Perl itself.
156
157
158
159perl v5.10.1                      2009-05-24      Test::CPAN::Meta::Version(3)
Impressum