Skip to content

Commit

Permalink
Import of BARBIE/Test-YAML-Meta-0.03 from CPAN.
Browse files Browse the repository at this point in the history
gitpan-cpan-distribution: Test-YAML-Meta
gitpan-cpan-version:      0.03
gitpan-cpan-path:         BARBIE/Test-YAML-Meta-0.03.tar.gz
gitpan-cpan-author:       BARBIE
gitpan-cpan-maturity:     released
  • Loading branch information
barbie authored and Gitpan committed Oct 26, 2014
1 parent ae24d36 commit e23d49d
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 92 deletions.
6 changes: 6 additions & 0 deletions 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

Expand Down
1 change: 0 additions & 1 deletion MANIFEST
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions 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 <barbie@cpan.org>
Expand All @@ -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
Expand Down
10 changes: 6 additions & 4 deletions README
Expand Up @@ -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.
Expand Down
14 changes: 8 additions & 6 deletions lib/Test/YAML/Meta.pm
Expand Up @@ -4,7 +4,7 @@ use warnings;
use strict;

use vars qw($VERSION);
$VERSION = '0.02';
$VERSION = '0.03';

#----------------------------------------------------------------------------

Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down
78 changes: 19 additions & 59 deletions lib/Test/YAML/Meta/Version.pm
Expand Up @@ -4,7 +4,7 @@ use warnings;
use strict;

use vars qw($VERSION);
$VERSION = '0.02';
$VERSION = '0.03';

#----------------------------------------------------------------------------

Expand Down Expand Up @@ -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' => {
Expand Down Expand Up @@ -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);
Expand All @@ -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";
}
Expand Down Expand Up @@ -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.
Expand Down
7 changes: 0 additions & 7 deletions t/92distribution.t

This file was deleted.

24 changes: 12 additions & 12 deletions t/samples/07-META.yml
Expand Up @@ -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

0 comments on commit e23d49d

Please sign in to comment.