diff --git a/Changes b/Changes index 43120ff..dcd1905 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ # Changes log for Test::YAML::Meta +0.03 27/02/2007 + - POD & comment updates + - removed 92distribution.t test as it can't detect that YAML::Syck is + optional + - fixed a misunderstanding of mine from the META.yml specification. + 0.02 27/02/2007 Fixed a bug in detecting module name diff --git a/MANIFEST b/MANIFEST index 80eee90..250e4cd 100644 --- a/MANIFEST +++ b/MANIFEST @@ -16,7 +16,6 @@ t/03metaversion.t t/04metatester.t t/90podtest.t t/91podcover.t -t/92distribution.t t/93metavalid.t t/94metatest.t t/samples/00-META.yml diff --git a/META.yml b/META.yml index 02b3af3..d8af443 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: Test-YAML-Meta -version: 0.02 +version: 0.03 abstract: A test module to validate a META.yml file. author: - Barbie @@ -24,15 +24,19 @@ build_requires: provides: Test::YAML::Meta: file: lib/Test/YAML/Meta.pm - version: 0.02 + version: 0.03 Test::YAML::Meta::Version: file: lib/Test/YAML/Meta/Version.pm - version: 0.02 + version: 0.03 no_index: directory: - t - examples +resources: + license: http://dev.perl.org/licenses/ + bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Test-YAML-Meta + meta-spec: version: 1.3 url: http://module-build.sourceforge.net/META-spec-v1.3.html diff --git a/README b/README index 98ae840..e010474 100644 --- a/README +++ b/README @@ -48,10 +48,12 @@ For a complete list of changes, see the Changes file. SUPPORT -If you spot a bug or are experiencing difficulties that are not explained -within the POD documentation, please send an email to barbie@cpan.org or -submit a bug to the RT system (http://rt.cpan.org/). It would help greatly -if you are able to pinpoint problems or even supply a patch. +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@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. Fixes are dependant upon their severity and my availablity. Should a fix not be forthcoming, please feel free to (politely) remind me. diff --git a/lib/Test/YAML/Meta.pm b/lib/Test/YAML/Meta.pm index ce152e6..bc0560b 100644 --- a/lib/Test/YAML/Meta.pm +++ b/lib/Test/YAML/Meta.pm @@ -4,7 +4,7 @@ use warnings; use strict; use vars qw($VERSION); -$VERSION = '0.02'; +$VERSION = '0.03'; #---------------------------------------------------------------------------- @@ -92,7 +92,7 @@ sub import { =over -=item * meta_yaml_ok($msg) +=item * meta_yaml_ok([$msg]) Basic META.yml wrapper around meta_spec_ok. @@ -103,9 +103,10 @@ sub meta_yaml_ok { meta_spec_ok(undef,undef,@_); } -=item * meta_spec_ok($file [,$version] [,$msg]) +=item * meta_spec_ok($file, $version [,$msg]) -Validates the named file against the given specification version. +Validates the named file against the given specification version. Both $file +and $version can be undefined. =back @@ -148,8 +149,9 @@ __END__ 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@cpan.org or submit a bug to the -RT system (http://rt.cpan.org/). 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. diff --git a/lib/Test/YAML/Meta/Version.pm b/lib/Test/YAML/Meta/Version.pm index cca34c8..2d59b8f 100644 --- a/lib/Test/YAML/Meta/Version.pm +++ b/lib/Test/YAML/Meta/Version.pm @@ -4,7 +4,7 @@ use warnings; use strict; use vars qw($VERSION); -$VERSION = '0.02'; +$VERSION = '0.03'; #---------------------------------------------------------------------------- @@ -81,16 +81,18 @@ my %definitions = ( 'optional_features' => { list => { - '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, - ':key' => { name => \&word, value => \&string_or_undef }, - } } + ':key' => { name => \&word, + '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' => { @@ -361,52 +363,6 @@ sub check_list { } } -# the following is a snippet from a valid META.yml file: -# -# 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 -# -# below is the snippet of data that YAML::LoadFile will return: -# -# 'optional_features' => [ -# { -# 'description' => 'test', -# 'build_requires' => { -# 'Test::More' => '0.47' -# }, -# 'requires_os' => 'test', -# 'excludes_os' => 'test', -# 'requires_packages' => 'test', -# 'conflicts' => { -# 'Test::More' => '0.47' -# }, -# 'requires' => { -# 'Test::More' => '0.47' -# }, -# 'foo' => undef, -# 'recommends' => { -# 'Test::More' => '0.47' -# } -# } -# ], -# -# Note that 'foo' is inside the hash, not the first item in the list. To me -# this is a design flaw, as it makes no sense to me having the list -# identifier as part of the hash. Plus it makes it painfully difficult to -# validate :( - for my $value (@$data) { if(defined $spec->{value}) { $spec->{value}->($self,'list',$value); @@ -415,6 +371,9 @@ sub check_list { } elsif(defined $spec->{'list'}) { $self->check_list($spec->{'list'},$value); + } elsif ($spec->{':key'}) { + $self->check_map($spec,$value); + } else { push @{$self->{errors}}, "Unknown value type, '$value', found in list structure"; } @@ -673,8 +632,9 @@ __END__ 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@cpan.org or submit a bug to the -RT system (http://rt.cpan.org/). 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. diff --git a/t/92distribution.t b/t/92distribution.t deleted file mode 100644 index 6021ba3..0000000 --- a/t/92distribution.t +++ /dev/null @@ -1,7 +0,0 @@ -use Test::More; - -BEGIN { - eval { require Test::Distribution; }; - if($@) { plan skip_all => 'Test::Distribution not installed'; } - else { import Test::Distribution; } -} \ No newline at end of file diff --git a/t/samples/07-META.yml b/t/samples/07-META.yml index 379748f..8383391 100644 --- a/t/samples/07-META.yml +++ b/t/samples/07-META.yml @@ -39,15 +39,15 @@ 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 + 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