r17948 - in /branches/upstream/libtest-yaml-meta-perl/current: Changes MANIFEST META.yml lib/Test/YAML/Meta.pm lib/Test/YAML/Meta/Version.pm t/03metaversion.t t/05metaspec.t

rmayorga-guest at users.alioth.debian.org rmayorga-guest at users.alioth.debian.org
Mon Mar 24 07:07:43 UTC 2008


Author: rmayorga-guest
Date: Mon Mar 24 07:07:42 2008
New Revision: 17948

URL: http://svn.debian.org/wsvn/?sc=1&rev=17948
Log:
[svn-upgrade] Integrating new upstream version, libtest-yaml-meta-perl (0.08)

Added:
    branches/upstream/libtest-yaml-meta-perl/current/t/05metaspec.t
Modified:
    branches/upstream/libtest-yaml-meta-perl/current/Changes
    branches/upstream/libtest-yaml-meta-perl/current/MANIFEST
    branches/upstream/libtest-yaml-meta-perl/current/META.yml
    branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta.pm
    branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta/Version.pm
    branches/upstream/libtest-yaml-meta-perl/current/t/03metaversion.t

Modified: branches/upstream/libtest-yaml-meta-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-yaml-meta-perl/current/Changes?rev=17948&op=diff
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/Changes (original)
+++ branches/upstream/libtest-yaml-meta-perl/current/Changes Mon Mar 24 07:07:42 2008
@@ -1,4 +1,18 @@
 # Changes log for Test::YAML::Meta
+
+0.08	17/03/2008
+	- it helps when you fix all the versioning too!
+
+0.07	17/03/2008
+	- fixed licensing list (adding Artistic2). (Bernhard Schmalhofer)
+	- value for license is mandatory, but the actual value could be any
+          string. Therefore the license() function now returns 1 if the given
+	  value is a known license type, returns 2 if a value is given, or 0
+	  if no value is given.
+	- hashref returned of the parsed META.yml file, by both meta_spec_ok()
+	  and meta_yaml_ok(), in the event the user wishes to perform addition
+	  checks on the values of the hash keys. (Adam Kennedy)
+	- added t/05metaspec.t test file.
 
 0.06	05/11/2007
 	- fixed RT#29457: distribution_type is not mandatory in spec 1.2 (domm)

Modified: branches/upstream/libtest-yaml-meta-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-yaml-meta-perl/current/MANIFEST?rev=17948&op=diff
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/MANIFEST (original)
+++ branches/upstream/libtest-yaml-meta-perl/current/MANIFEST Mon Mar 24 07:07:42 2008
@@ -14,6 +14,7 @@
 t/02metafiles.t
 t/03metaversion.t
 t/04metatester.t
+t/05metaspec.t
 t/90podtest.t
 t/91podcover.t
 t/94metatest.t

Modified: branches/upstream/libtest-yaml-meta-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-yaml-meta-perl/current/META.yml?rev=17948&op=diff
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/META.yml (original)
+++ branches/upstream/libtest-yaml-meta-perl/current/META.yml Mon Mar 24 07:07:42 2008
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                     Test-YAML-Meta
-version:                  0.06
+version:                  0.08
 abstract:                 A test module to validate a META.yml file.
 author:
   - Barbie <barbie at cpan.org>
@@ -24,10 +24,10 @@
 provides:
   Test::YAML::Meta:
     file:     lib/Test/YAML/Meta.pm
-    version:  0.06
+    version:  0.08
   Test::YAML::Meta::Version:
     file:     lib/Test/YAML/Meta/Version.pm
-    version:  0.06
+    version:  0.08
 no_index:
   directory:
     - t

Modified: branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta.pm?rev=17948&op=diff
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta.pm (original)
+++ branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta.pm Mon Mar 24 07:07:42 2008
@@ -4,7 +4,7 @@
 use strict;
 
 use vars qw($VERSION);
-$VERSION = '0.06';
+$VERSION = '0.08';
 
 #----------------------------------------------------------------------------
 
@@ -14,7 +14,7 @@
 
 =head1 SYNOPSIS
 
-There are two forms this module can be used. 
+There are two forms this module can be used.
 
 The first is a standalone test of your distribution's META.yml file:
 
@@ -23,7 +23,7 @@
   plan skip_all => "Test::YAML::Meta required for testing META.yml" if $@;
   meta_yaml_ok();
 
-Note that you may provide an optional label/comment/message/etc to the 
+Note that you may provide an optional label/comment/message/etc to the
 function, or one will be created automatically.
 
 The second form allows you to test other META.yml files, or specify a specific
@@ -33,14 +33,14 @@
   use Test::YAML::Meta;
 
   # specify a file and specification version
-  meta_spec_ok('META.yml','1.3',$msg);       
+  meta_spec_ok('META.yml','1.3',$msg);
 
   # specify the specification version to validate the local META.yml
-  meta_spec_ok(undef,'1.3',$msg);       
+  meta_spec_ok(undef,'1.3',$msg);
 
-  # specify a file, where the specification version is deduced 
+  # specify a file, where the specification version is deduced
   # from the file itself
-  meta_spec_ok('META.yml',undef,$msg);       
+  meta_spec_ok('META.yml',undef,$msg);
 
 Note that this form requires you to specify the number of tests you will be
 running in your test script. Also note that each 'meta_spec_ok' is actually 2
@@ -48,8 +48,8 @@
 
 =head1 DESCRIPTION
 
-This module was written to ensure that a META.yml file, provided with a 
-standard distribution uploaded to CPAN, meets the specifications that slowly 
+This module was written to ensure that a META.yml file, provided with a
+standard distribution uploaded to CPAN, meets the specifications that slowly
 being introduced to module uploads, via the use of L<ExtUtils::MakeMaker>,
 L<Module::Build> and L<Module::Install>.
 
@@ -100,12 +100,12 @@
 
 sub meta_yaml_ok {
     $Test->plan( tests => 2 );
-    meta_spec_ok(undef,undef, at _);
+    return meta_spec_ok(undef,undef, at _);
 }
 
 =item * meta_spec_ok($file, $version [,$msg])
 
-Validates the named file against the given specification version. Both $file 
+Validates the named file against the given specification version. Both $file
 and $version can be undefined.
 
 =back
@@ -133,12 +133,15 @@
         } else {
             $Test->ok(1,$msg);
         }
+
+        return $yaml;
+
     } else {
         print STDERR "\n#Failed\n";
     }
 }
 
-q( Currently Listening To: Curve - "Gift" );
+q( Currently Listening To: Blondie - "Screaming Skin" from 'No Exit');
 
 __END__
 
@@ -149,9 +152,9 @@
 There are no known bugs at the time of this release. However, if you spot a
 bug or are experiencing difficulties that are not explained within the POD
 documentation, please send an email to barbie at cpan.org or submit a bug to the
-RT system (http://rt.cpan.org/Public/Dist/Display.html?Name=Test-YAML-Meta). 
-However, it would help greatly if you are able to pinpoint problems or even 
-supply a patch. 
+RT system (http://rt.cpan.org/Public/Dist/Display.html?Name=Test-YAML-Meta).
+However, it would help greatly if you are able to pinpoint problems or even
+supply a patch.
 
 Fixes are dependant upon their severity and my availablity. Should a fix not
 be forthcoming, please feel free to (politely) remind me.
@@ -177,7 +180,7 @@
 
   Copyright (C) 2007 Barbie for Miss Barbell Productions
 
-  This module is free software; you can redistribute it and/or 
+  This module is free software; you can redistribute it and/or
   modify it under the same terms as Perl itself.
 
 =cut

Modified: branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta/Version.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta/Version.pm?rev=17948&op=diff
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta/Version.pm (original)
+++ branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta/Version.pm Mon Mar 24 07:07:42 2008
@@ -4,7 +4,7 @@
 use strict;
 
 use vars qw($VERSION);
-$VERSION = '0.06';
+$VERSION = '0.08';
 
 #----------------------------------------------------------------------------
 
@@ -18,9 +18,9 @@
 
 =head1 DESCRIPTION
 
-This module was written to ensure that a META.yml file, provided with a 
-standard distribution uploaded to CPAN, meets the specifications that are 
-slowly being introduced to module uploads, via the use of 
+This module was written to ensure that a META.yml file, provided with a
+standard distribution uploaded to CPAN, meets the specifications that are
+slowly being introduced to module uploads, via the use of
 L<ExtUtils::MakeMaker>, L<Module::Build> and L<Module::Install>.
 
 This module is meant to be used together with L<Test::YAML::Meta>, however
@@ -61,27 +61,28 @@
 
 my %definitions = (
 '1.3' => {
-#  'header'          => { mandatory => 1, value => \&header },
-  'meta-spec'       => { mandatory => 1, 'map' => { version => { mandatory => 1, value => \&version}, 
-                                                    url     => { mandatory => 1, value => \&urlspec } } },
-
-  'name'            => { mandatory => 1, value => \&string  },
-  'version'         => { mandatory => 1, value => \&version },
-  'license'         => { mandatory => 1, value => \&license },
-  'generated_by'    => { mandatory => 1, value => \&string  },
-  'author'          => { mandatory => 1, list  => { value => \&string } },
-
-  'abstract'        => { value => \&string  },
-  'dynamic_config'  => { value => \&boolean },
-
-  'requires'        => $module_map1,
-  'recommends'      => $module_map1,
-  'build_requires'  => $module_map1,
-  'conflicts'       => $module_map2,
+#  'header'              => { mandatory => 1, value => \&header },
+  'meta-spec'           => { mandatory => 1, 'map' => { version => { mandatory => 1, value => \&version},
+                                                        url     => { mandatory => 1, value => \&urlspec } } },
+
+  'name'                => { mandatory => 1, value => \&string  },
+  'version'             => { mandatory => 1, value => \&version },
+  'abstract'            => { mandatory => 1, value => \&string  },
+  'author'              => { mandatory => 1, list  => { value => \&string } },
+  'license'             => { mandatory => 1, value => \&license },
+  'generated_by'        => { mandatory => 1, value => \&string  },
+
+  'distribution_type'   => { value => \&string  },
+  'dynamic_config'      => { value => \&boolean },
+
+  'requires'            => $module_map1,
+  'recommends'          => $module_map1,
+  'build_requires'      => $module_map1,
+  'conflicts'           => $module_map2,
 
   'optional_features'   => {
-    list        => { 
-        ':key'  => { name => \&word, 
+    list        => {
+        ':key'  => { name => \&word,
             'map'   => { description        => { value => \&string },
                          requires_packages  => { value => \&string },
                          requires_os        => { value => \&string },
@@ -97,7 +98,7 @@
 
   'provides'    => {
     'map'       => { ':key' => { name  => \&module,
-                                 'map' => { file    => { mandatory => 1, value => \&file }, 
+                                 'map' => { file    => { mandatory => 1, value => \&file },
                                             version => { value => \&version } } } }
   },
 
@@ -117,7 +118,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 => \&word },
 },
 
 # v1.2 is misleading, it seems to assume that a number of fields where created
@@ -126,7 +127,7 @@
 # v1.2 was originally slated as v1.1. But I could be wrong ;)
 '1.2' => {
 #  'header'              => { mandatory => 1, value => \&header },
-  'meta-spec'           => { mandatory => 1, 'map' => { version => { mandatory => 1, value => \&version}, 
+  'meta-spec'           => { mandatory => 1, 'map' => { version => { mandatory => 1, value => \&version},
                                                         url     => { mandatory => 1, value => \&urlspec } } },
 
   'name'                => { mandatory => 1, value => \&string  },
@@ -150,8 +151,8 @@
   'conflicts'           => $module_map2,
 
   'provides'    => {
-    'map'       => { ':key' => { name  => \&module, 
-                                 'map' => { file    => { mandatory => 1, value => \&file }, 
+    'map'       => { ':key' => { name  => \&module,
+                                 'map' => { file    => { mandatory => 1, value => \&file },
                                             version => { value => \&version } } } }
   },
 
@@ -166,7 +167,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 => \&word },
 },
 
 # note that the 1.1 spec doesn't specify optional or mandatory fields, what
@@ -191,12 +192,12 @@
 
   # 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 => \&word },
 },
 
 # note that the 1.0 spec doesn't specify optional or mandatory fields, what
 # appears below is assumed from later specifications.
-'1.0' => {      
+'1.0' => {
 #  'header'              => { mandatory => 1, value => \&header },
   'name'                => { mandatory => 1, value => \&string  },
   'version'             => { mandatory => 1, value => \&version },
@@ -213,7 +214,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 => \&word },
 },
 );
 
@@ -227,11 +228,11 @@
 
 =item * new( yaml => $yaml [, spec => $version] )
 
-The constructor must be passed a valid YAML data structure. 
+The constructor must be passed a valid YAML data structure.
 
 Optionally you may also provide a specification version. This version is then
-use to ensure that the given YAML data structure meets the respective 
-specification definition. If no version is provided the module will attempt to 
+use to ensure that the given YAML data structure meets the respective
+specification definition. If no version is provided the module will attempt to
 deduce the appropriate specification version from the data structure itself.
 
 =back
@@ -259,7 +260,7 @@
 
 =item * parse()
 
-Using the YAML data structure provided with the constructure, attempts to 
+Using the YAML data structure provided with the constructure, attempts to
 parse and validate according to the appropriate specification definition.
 
 Returns 1 if any errors found, otherwise returns 0.
@@ -296,12 +297,12 @@
 
 =item * check_map($spec,$data)
 
-Checks whether a map (or hash) part of the YAML data structure conforms to the 
+Checks whether a map (or hash) part of the YAML data structure conforms to the
 appropriate specification definition.
 
 =item * check_list($spec,$data)
 
-Checks whether a list (or array) part of the YAML data structure conforms to 
+Checks whether a list (or array) part of the YAML data structure conforms to
 the appropriate specification definition.
 
 =back
@@ -406,7 +407,7 @@
 
 =item * string_or_undef($self,$key,$value)
 
-Validates that the value is either a string or an undef value. Bit of a 
+Validates that the value is either a string or an undef value. Bit of a
 catchall function for parts of the data structure that are completely user
 defined.
 
@@ -430,16 +431,17 @@
 
 =item * boolean($self,$key,$value)
 
-Validates for a boolean value. Currently these values are '1', '0', 'true', 
+Validates for a boolean value. Currently these values are '1', '0', 'true',
 'false', however the latter 2 may be removed.
 
 =item * license($self,$key,$value)
 
-Validates that the given value represents an known license type.
+Validates that a value is given for the license. Returns 1 if an known license
+type, or 2 if a value is given but the license type is not a recommended one.
 
 =item * resource($self,$key,$value)
 
-Validates that the given key is in CamelCase, to indicate a user defined 
+Validates that the given key is in CamelCase, to indicate a user defined
 keyword.
 
 =item * word($self,$key,$value)
@@ -449,7 +451,7 @@
 
 =item * module($self,$key,$value)
 
-Validates that a given key is in an acceptable module name format, e.g. 
+Validates that a given key is in an acceptable module name format, e.g.
 'Test::YAML::Meta::Version'.
 
 =back
@@ -579,25 +581,28 @@
 }
 
 my %licenses = (
-    perl         => 'http://dev.perl.org/licenses/',
-    gpl          => 'http://www.opensource.org/licenses/gpl-license.php',
-    apache       => 'http://apache.org/licenses/LICENSE-2.0',
-    artistic     => 'http://opensource.org/licenses/artistic-license.php',
-    lgpl         => 'http://opensource.org/licenses/artistic-license.php',
-    bsd          => 'http://www.opensource.org/licenses/bsd-license.php',
-    gpl          => 'http://www.opensource.org/licenses/gpl-license.php',
-    mit          => 'http://opensource.org/licenses/mit-license.php',
-    mozilla      => 'http://opensource.org/licenses/mozilla1.1.php',
-    open_source  => undef,
-    unrestricted => undef,
-    restrictive  => undef,
-    unknown      => undef,
+    'perl'         => 'http://dev.perl.org/licenses/',
+    'gpl'          => 'http://www.opensource.org/licenses/gpl-license.php',
+    'apache'       => 'http://apache.org/licenses/LICENSE-2.0',
+    'artistic'     => 'http://opensource.org/licenses/artistic-license.php',
+    'artistic2'    => 'http://opensource.org/licenses/artistic-license-2.0.php',
+    'artistic-2.0' => 'http://opensource.org/licenses/artistic-license-2.0.php',
+    'lgpl'         => 'http://www.opensource.org/licenses/lgpl-license.phpt',
+    'bsd'          => 'http://www.opensource.org/licenses/bsd-license.php',
+    'gpl'          => 'http://www.opensource.org/licenses/gpl-license.php',
+    'mit'          => 'http://opensource.org/licenses/mit-license.php',
+    'mozilla'      => 'http://opensource.org/licenses/mozilla1.1.php',
+    'open_source'  => undef,
+    'unrestricted' => undef,
+    'restrictive'  => undef,
+    'unknown'      => undef,
 );
 
 sub license {
     my ($self,$key,$value) = @_;
     if(defined $value) {
         return 1    if($value && exists $licenses{$value});
+        return 2    if($value);
     } else {
         $value = '<undef>';
     }
@@ -648,7 +653,7 @@
     push @{$self->{errors}}, $mess;
 }
 
-q( Currently Listening To: The Nefilim - "Zoon" );
+q( Currently Listening To: Joy Division - "Digital" from 'Unknown Pleasures');
 
 __END__
 
@@ -659,9 +664,9 @@
 There are no known bugs at the time of this release. However, if you spot a
 bug or are experiencing difficulties that are not explained within the POD
 documentation, please send an email to barbie at cpan.org or submit a bug to the
-RT system (http://rt.cpan.org/Public/Dist/Display.html?Name=Test-YAML-Meta). 
-However, it would help greatly if you are able to pinpoint problems or even 
-supply a patch. 
+RT system (http://rt.cpan.org/Public/Dist/Display.html?Name=Test-YAML-Meta).
+However, it would help greatly if you are able to pinpoint problems or even
+supply a patch.
 
 Fixes are dependant upon their severity and my availablity. Should a fix not
 be forthcoming, please feel free to (politely) remind me.
@@ -683,7 +688,7 @@
 
   Copyright (C) 2007 Barbie for Miss Barbell Productions
 
-  This module is free software; you can redistribute it and/or 
+  This module is free software; you can redistribute it and/or
   modify it under the same terms as Perl itself.
 
 =cut

Modified: branches/upstream/libtest-yaml-meta-perl/current/t/03metaversion.t
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-yaml-meta-perl/current/t/03metaversion.t?rev=17948&op=diff
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/t/03metaversion.t (original)
+++ branches/upstream/libtest-yaml-meta-perl/current/t/03metaversion.t Mon Mar 24 07:07:42 2008
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 
-use Test::More  tests => 84;
+use Test::More  tests => 86;
 use Test::YAML::Meta::Version;
 
 my $spec = Test::YAML::Meta::Version->new(spec => '1.3');
@@ -64,10 +64,10 @@
 is($spec->boolean('boolean',undef),0,   'boolean = (undef value)');
 is($spec->boolean('boolean'),0,         'boolean = (undef)');
 
-for my $value (qw( perl gpl apache artistic lgpl bsd gpl mit mozilla open_source unrestricted restrictive unknown )) {
+for my $value (qw( perl gpl apache artistic artistic2 artistic-2.0 lgpl bsd gpl mit mozilla open_source unrestricted restrictive unknown )) {
     is($spec->license('license',$value),1,'license test = ' . $value);
 }
-is($spec->license('license','blah'),0);
+is($spec->license('license','blah'),2);
 is($spec->license('license',''),0);
 is($spec->license('license',undef),0);
 

Added: branches/upstream/libtest-yaml-meta-perl/current/t/05metaspec.t
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-yaml-meta-perl/current/t/05metaspec.t?rev=17948&op=file
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/t/05metaspec.t (added)
+++ branches/upstream/libtest-yaml-meta-perl/current/t/05metaspec.t Mon Mar 24 07:07:42 2008
@@ -1,0 +1,15 @@
+#!/usr/bin/perl -w
+use strict;
+
+use Test::More  tests => 3;
+use Test::YAML::Meta;
+
+my $vers = '1.3';
+my $test = 't/samples/00-META.yml';
+
+my $meta = meta_spec_ok($test,$vers);
+
+#use Data::Dumper;
+#diag(Dumper($meta));
+
+is($meta->{license}, 'perl', 'hash value for license matches');




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