r48972 - in /trunk/libtest-yaml-meta-perl: Changes META.yml debian/changelog lib/Test/YAML/Meta.pm lib/Test/YAML/Meta/Version.pm t/03metaversion.t t/samples/07-META.yml

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Dec 19 00:18:11 UTC 2009


Author: jawnsy-guest
Date: Sat Dec 19 00:18:05 2009
New Revision: 48972

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=48972
Log:
integrate new release, not sure how to proceed

Modified:
    trunk/libtest-yaml-meta-perl/Changes
    trunk/libtest-yaml-meta-perl/META.yml
    trunk/libtest-yaml-meta-perl/debian/changelog
    trunk/libtest-yaml-meta-perl/lib/Test/YAML/Meta.pm
    trunk/libtest-yaml-meta-perl/lib/Test/YAML/Meta/Version.pm
    trunk/libtest-yaml-meta-perl/t/03metaversion.t
    trunk/libtest-yaml-meta-perl/t/samples/07-META.yml

Modified: trunk/libtest-yaml-meta-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-yaml-meta-perl/Changes?rev=48972&op=diff
==============================================================================
--- trunk/libtest-yaml-meta-perl/Changes (original)
+++ trunk/libtest-yaml-meta-perl/Changes Sat Dec 19 00:18:05 2009
@@ -1,4 +1,19 @@
 # Changes log for Test::YAML::Meta
+
+0.15    18/12/2009
+	- renamed word() to keyword().
+	- added identifier() validation.
+	- changed optional_features key from a keyword to an identifier type,
+	  thus further clarifying RT#52685 (thanks Kevin).
+
+0.14    12/12/2009
+	- clarified spec defined and user defined keys, as promoted by Kevin
+	  Ryde in RT#52685 (thanks Kevin).
+
+0.13    07/12/2009
+	- RT#46473: license url with fragment part (Kevin Ryde)
+	- RT#47393: "optional_features" as map rather than list (Kevin Ryde)
+	- above applied to 1.4, 1.3 and 1.2 version of the meta-spec.
 
 0.12    24/05/2009
 	- added version checking to standard 94metatest.t

Modified: trunk/libtest-yaml-meta-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-yaml-meta-perl/META.yml?rev=48972&op=diff
==============================================================================
--- trunk/libtest-yaml-meta-perl/META.yml (original)
+++ trunk/libtest-yaml-meta-perl/META.yml Sat Dec 19 00:18:05 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                     Test-YAML-Meta
-version:                  0.12
+version:                  0.15
 abstract:                 A test module to validate a META.yml file.
 author:
   - Barbie <barbie at cpan.org>
@@ -27,10 +27,10 @@
 provides:
   Test::YAML::Meta:
     file:     lib/Test/YAML/Meta.pm
-    version:  0.12
+    version:  0.15
   Test::YAML::Meta::Version:
     file:     lib/Test/YAML/Meta/Version.pm
-    version:  0.12
+    version:  0.15
 no_index:
   directory:
     - t

Modified: trunk/libtest-yaml-meta-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-yaml-meta-perl/debian/changelog?rev=48972&op=diff
==============================================================================
--- trunk/libtest-yaml-meta-perl/debian/changelog (original)
+++ trunk/libtest-yaml-meta-perl/debian/changelog Sat Dec 19 00:18:05 2009
@@ -1,4 +1,4 @@
-libtest-yaml-meta-perl (0.14-1) UNRELEASED; urgency=low
+libtest-yaml-meta-perl (0.15-1) UNRELEASED; urgency=low
 
   NOTE: still need to look at this more closely..
 
@@ -13,7 +13,7 @@
   * debian/control: Changed: (build-)depend on perl instead of perl-
     modules.
 
- -- Jonathan Yu <jawnsy at cpan.org>  Tue, 15 Dec 2009 16:43:54 -0500
+ -- Jonathan Yu <jawnsy at cpan.org>  Fri, 18 Dec 2009 16:10:20 -0500
 
 libtest-yaml-meta-perl (0.12-1) unstable; urgency=low
 

Modified: trunk/libtest-yaml-meta-perl/lib/Test/YAML/Meta.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-yaml-meta-perl/lib/Test/YAML/Meta.pm?rev=48972&op=diff
==============================================================================
--- trunk/libtest-yaml-meta-perl/lib/Test/YAML/Meta.pm (original)
+++ trunk/libtest-yaml-meta-perl/lib/Test/YAML/Meta.pm Sat Dec 19 00:18:05 2009
@@ -4,7 +4,7 @@
 use strict;
 
 use vars qw($VERSION);
-$VERSION = '0.12';
+$VERSION = '0.15';
 
 #----------------------------------------------------------------------------
 
@@ -147,6 +147,29 @@
 
 #----------------------------------------------------------------------------
 
+=head1 TESTING META FILES
+
+There are currently 3 distributions to test META files:
+
+  Test-CPAN-Meta
+  Test-JSON-Meta
+  Test-YAML-Meta
+
+All three have slightly different requirements and are intended to be used in
+slightly different environments. 
+
+Test-YAML-Meta requires a YAML parser, and currently looks for the YAML or 
+YAML::Syck modules. This is the original variant of the 3 and was intended to
+provide a more complete YAML validation of a META.yml.
+
+Test-CPAN-Meta requires the Parse::CPAN::Meta module, which is now part of Perl
+Core as of perl-5.10.1. This version is intended to be used by those only 
+wishing to rely on core modules to test their META.yml files.
+
+Test-JSON-Meta is the most recent addition to the family, and is specifically
+aimed at those distributions that use a META.json Meta file. The distribution
+requires the JSON module to parse the Meta file.
+
 =head1 BUGS, PATCHES & FIXES
 
 There are no known bugs at the time of this release. However, if you spot a
@@ -178,7 +201,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-  Copyright (C) 2007,2008 Barbie for Miss Barbell Productions
+  Copyright (C) 2007-2010 Barbie for Miss Barbell Productions
 
   This module is free software; you can redistribute it and/or
   modify it under the same terms as Perl itself.

Modified: trunk/libtest-yaml-meta-perl/lib/Test/YAML/Meta/Version.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-yaml-meta-perl/lib/Test/YAML/Meta/Version.pm?rev=48972&op=diff
==============================================================================
--- trunk/libtest-yaml-meta-perl/lib/Test/YAML/Meta/Version.pm (original)
+++ trunk/libtest-yaml-meta-perl/lib/Test/YAML/Meta/Version.pm Sat Dec 19 00:18:05 2009
@@ -4,7 +4,7 @@
 use strict;
 
 use vars qw($VERSION);
-$VERSION = '0.12';
+$VERSION = '0.15';
 
 #----------------------------------------------------------------------------
 
@@ -64,7 +64,7 @@
     }
 };
 my $no_index_1_1 = {
-    'map'       => { ':key'     => { name => \&word, list => { value => \&string } },
+    'map'       => { ':key'     => { name => \&keyword, list => { value => \&string } },
     }
 };
 
@@ -91,8 +91,8 @@
   'conflicts'           => $module_map2,
 
   'optional_features'   => {
-    list        => {
-        ':key'  => { name => \&word,
+    'map'       => {
+        ':key'  => { name => \&identifier,
             'map'   => { description        => { value => \&string },
                          requires_packages  => { value => \&string },
                          requires_os        => { value => \&string },
@@ -128,7 +128,7 @@
 
   # additional user defined key/value pairs
   # note we can only validate the key name, as the structure is user defined
-  ':key'        => { name => \&word },
+  ':key'        => { name => \&keyword },
 },
 
 '1.3' => {
@@ -152,8 +152,8 @@
   'conflicts'           => $module_map2,
 
   'optional_features'   => {
-    list        => {
-        ':key'  => { name => \&word,
+    'map'       => {
+        ':key'  => { name => \&identifier,
             'map'   => { description        => { value => \&string },
                          requires_packages  => { value => \&string },
                          requires_os        => { value => \&string },
@@ -189,7 +189,7 @@
 
   # additional user defined key/value pairs
   # note we can only validate the key name, as the structure is user defined
-  ':key'        => { name => \&word },
+  ':key'        => { name => \&keyword },
 },
 
 # v1.2 is misleading, it seems to assume that a number of fields where created
@@ -221,6 +221,22 @@
   'build_requires'      => $module_map1,
   'conflicts'           => $module_map2,
 
+  'optional_features'   => {
+    'map'       => {
+        ':key'  => { name => \&identifier,
+            'map'   => { description        => { value => \&string },
+                         requires_packages  => { value => \&string },
+                         requires_os        => { value => \&string },
+                         excludes_os        => { value => \&string },
+                         requires           => $module_map1,
+                         recommends         => $module_map1,
+                         build_requires     => $module_map1,
+                         conflicts          => $module_map2,
+            }
+        }
+     }
+  },
+
   'provides'    => {
     'map'       => { ':key' => { name  => \&module,
                                  'map' => { file    => { mandatory => 1, value => \&file },
@@ -238,7 +254,7 @@
 
   # additional user defined key/value pairs
   # note we can only validate the key name, as the structure is user defined
-  ':key'        => { name => \&word },
+  ':key'        => { name => \&keyword },
 },
 
 # note that the 1.1 spec doesn't specify optional or mandatory fields, what
@@ -263,7 +279,7 @@
 
   # additional user defined key/value pairs
   # note we can only validate the key name, as the structure is user defined
-  ':key'        => { name => \&word },
+  ':key'        => { name => \&keyword },
 },
 
 # note that the 1.0 spec doesn't specify optional or mandatory fields, what
@@ -285,7 +301,7 @@
 
   # additional user defined key/value pairs
   # note we can only validate the key name, as the structure is user defined
-  ':key'        => { name => \&word },
+  ':key'        => { name => \&keyword },
 },
 );
 
@@ -520,10 +536,21 @@
 Validates that the given key is in CamelCase, to indicate a user defined
 keyword.
 
-=item * word($self,$key,$value)
+=item * keyword($self,$key,$value)
 
 Validates that key is in an acceptable format for the META.yml specification,
-i.e. any in the character class [-_a-z].
+i.e. any in the character class [-_a-z]. 
+
+For user defined keys, although not explicitly stated in the specifications 
+(v1.0 - v1.4), the convention is to precede the key with a pattern matching 
+qr{\Ax_}i. Following this any character from the character class [-_a-zA-Z]
+can be used. This clarification has been added to v2.0 of the specification.
+
+=item * identifier($self,$key,$value)
+
+Validates that key is in an acceptable format for the META.yml specification,
+for an identifier, i.e. any that matches the regular expression
+qr/[a-z][a-z_]/i. 
 
 =item * module($self,$key,$value)
 
@@ -551,7 +578,7 @@
 my $domain   = qr¬((($atom(($atom|-)*$atom)?)\.)*([a-zA-Z](($atom|-)*$atom)?))¬;
 my $ip       = qr¬((\d+)(\.(\d+)){3})(:(\d+))?¬;
 my $enc      = qr¬%[a-fA-F\d]{2}¬;
-my $legal1   = qr¬[a-zA-Z\d\$\-_.+!*'(),]¬; #' - this comment is to avoid syntax highlighting issues
+my $legal1   = qr¬[a-zA-Z\d\$\-_.+!*'(),#]¬; #' - this comment is to avoid syntax highlighting issues
 my $legal2   = qr¬[;:@&=]¬;
 my $legal3   = qr¬((($legal1|$enc)|$legal2)*)¬;
 my $path     = qr¬\/$legal3(\/$legal3)*¬;
@@ -691,14 +718,26 @@
     return 0;
 }
 
-sub word {
+sub keyword {
     my ($self,$key) = @_;
     if(defined $key) {
-        return 1    if($key && $key =~ /^([-_a-z]+)$/);
+        return 1    if($key && $key =~ /^([-_a-z]+)$/);     # spec defined
+        return 1    if($key && $key =~ /^x_([-_a-z]+)$/i);  # user defined
     } else {
         $key = '<undef>';
     }
     $self->_error( "Key '$key' is not a legal keyword." );
+    return 0;
+}
+
+sub identifier {
+    my ($self,$key) = @_;
+    if(defined $key) {
+        return 1    if($key && $key =~ /^([a-z][_a-z]+)$/i);    # spec 2.0 defined
+    } else {
+        $key = '<undef>';
+    }
+    $self->_error( "Key '$key' is not a legal identifier." );
     return 0;
 }
 
@@ -756,7 +795,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-  Copyright (C) 2007,2008 Barbie for Miss Barbell Productions
+  Copyright (C) 2007-2010 Barbie for Miss Barbell Productions
 
   This module is free software; you can redistribute it and/or
   modify it under the same terms as Perl itself.

Modified: trunk/libtest-yaml-meta-perl/t/03metaversion.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-yaml-meta-perl/t/03metaversion.t?rev=48972&op=diff
==============================================================================
--- trunk/libtest-yaml-meta-perl/t/03metaversion.t (original)
+++ trunk/libtest-yaml-meta-perl/t/03metaversion.t Sat Dec 19 00:18:05 2009
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 
-use Test::More  tests => 91;
+use Test::More  tests => 108;
 use Test::YAML::Meta::Version;
 
 my $spec = Test::YAML::Meta::Version->new(spec => '1.3');
@@ -18,6 +18,8 @@
 is($spec->url('url','test^example^com'),0);
 is($spec->url('url',''),0);
 is($spec->url('url',undef),0);
+
+is($spec->url('url','http://www.gnu.org/licenses/#GPL'),1,'valid URL: http://www.gnu.org/licenses/#GPL');
 
 is($spec->urlspec('spec','http://module-build.sourceforge.net/META-spec-v1.3.html'),1,'valid specification URL');
 is($spec->urlspec('spec','http://module-build.sourceforge.net/META-spec-v1.2.html'),0);
@@ -81,12 +83,15 @@
 is($spec->resource(''),0);
 is($spec->resource(undef),0);
 
-is($spec->word('test'),1,'valid word');
-is($spec->word('test-test'),1);
-is($spec->word('test_test'),1);
-is($spec->word('test:'),0);
-is($spec->word(''),0);
-is($spec->word(undef),0);
+is($spec->keyword($_),1,"valid keyword $_")     for(qw(test X_TEST x_test test-test test_test));
+is($spec->keyword($_),0,"invalid keyword $_")   for(qw(X-TEST Test TEST test:));
+is($spec->keyword(''),0,'invalid keyword <empty string>');
+is($spec->keyword(undef),0,'invalid keyword <undef>');
+
+is($spec->identifier($_),1,"valid identifier $_")   for(qw(test Test TEST X_TEST x_test test_test));
+is($spec->identifier($_),0,"invalid identifier $_") for(qw(X-TEST test-test test:));
+is($spec->identifier(''),0,'invalid identifier <empty string>');
+is($spec->identifier(undef),0,'invalid identifier <undef>');
 
 is($spec->module('Test'),1,'valid module name');
 is($spec->module('Test::YAML::Meta'),1);

Modified: trunk/libtest-yaml-meta-perl/t/samples/07-META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-yaml-meta-perl/t/samples/07-META.yml?rev=48972&op=diff
==============================================================================
--- trunk/libtest-yaml-meta-perl/t/samples/07-META.yml (original)
+++ trunk/libtest-yaml-meta-perl/t/samples/07-META.yml Sat Dec 19 00:18:05 2009
@@ -38,16 +38,16 @@
 generated_by: Hand 1.0
 
 optional_features:
-  - foo:
-      description:        test
-      requires_packages:  test
-      requires_os:        test
-      excludes_os:        test
-      requires:
-        Test::More:       0.47
-      recommends:
-        Test::More:       0.47
-      build_requires:
-        Test::More:       0.47
-      conflicts:
-        Test::More:       0.47
+  foo:
+    description:        test
+    requires_packages:  test
+    requires_os:        test
+    excludes_os:        test
+    requires:
+      Test::More:       0.47
+    recommends:
+      Test::More:       0.47
+    build_requires:
+      Test::More:       0.47
+    conflicts:
+      Test::More:       0.47




More information about the Pkg-perl-cvs-commits mailing list