cpan/CPAN-Meta/t/converter-bad.t
cpan/CPAN-Meta/t/converter-fail.t
cpan/CPAN-Meta/t/converter.t
-cpan/CPAN-Meta/t/data-bad/107650337-META.yml
-cpan/CPAN-Meta/t/data-bad/1122575719-META.yml
-cpan/CPAN-Meta/t/data-bad/1206545041-META.yml
-cpan/CPAN-Meta/t/data-bad/1598804075-META.yml
-cpan/CPAN-Meta/t/data-bad/1927486199-META.yml
-cpan/CPAN-Meta/t/data-bad/1985684504-META.yml
-cpan/CPAN-Meta/t/data-bad/1985980974-META.yml
-cpan/CPAN-Meta/t/data-bad/2031017050-META.yml
-cpan/CPAN-Meta/t/data-bad/284247103-META.yml
-cpan/CPAN-Meta/t/data-bad/344981821-META.yml
-cpan/CPAN-Meta/t/data-bad/35478989-META.yml
-cpan/CPAN-Meta/t/data-bad/476602558-META.yml
-cpan/CPAN-Meta/t/data-bad/98042513-META.yml
-cpan/CPAN-Meta/t/data-bad/META-1_0.yml
-cpan/CPAN-Meta/t/data-bad/META-1_1.yml
-cpan/CPAN-Meta/t/data-bad/META-1_2.yml
-cpan/CPAN-Meta/t/data-bad/META-1_3.yml
-cpan/CPAN-Meta/t/data-bad/META-1_4.yml
-cpan/CPAN-Meta/t/data-bad/META-2.json
-cpan/CPAN-Meta/t/data-bad/restrictive-2.json
-cpan/CPAN-Meta/t/data-bad/version-ranges-2.json
cpan/CPAN-Meta/t/data-fail/META-1_0.yml
cpan/CPAN-Meta/t/data-fail/META-1_1.yml
cpan/CPAN-Meta/t/data-fail/META-1_2.yml
cpan/CPAN-Meta/t/data-fail/META-1_3.yml
cpan/CPAN-Meta/t/data-fail/META-1_4.yml
cpan/CPAN-Meta/t/data-fail/META-2.json
-cpan/CPAN-Meta/t/data/gpl-1_4.yml
-cpan/CPAN-Meta/t/data/META-1_0.yml
-cpan/CPAN-Meta/t/data/META-1_1.yml
-cpan/CPAN-Meta/t/data/META-1_2.yml
-cpan/CPAN-Meta/t/data/META-1_3.yml
-cpan/CPAN-Meta/t/data/META-1_4.yml
-cpan/CPAN-Meta/t/data/META-2.json
-cpan/CPAN-Meta/t/data/provides-version-missing.json
-cpan/CPAN-Meta/t/data/resources.yml
-cpan/CPAN-Meta/t/data/restricted-2.json
-cpan/CPAN-Meta/t/data/restrictive-1_4.yml
-cpan/CPAN-Meta/t/data/unicode.yml
-cpan/CPAN-Meta/t/data/version-not-normal.json
-cpan/CPAN-Meta/t/data/version-ranges-1_4.yml
-cpan/CPAN-Meta/t/data/version-ranges-2.json
+cpan/CPAN-Meta/t/data-fixable/107650337-META.yml
+cpan/CPAN-Meta/t/data-fixable/1598804075-META.yml
+cpan/CPAN-Meta/t/data-fixable/1927486199-META.yml
+cpan/CPAN-Meta/t/data-fixable/1985980974-META.yml
+cpan/CPAN-Meta/t/data-fixable/2031017050-META.yml
+cpan/CPAN-Meta/t/data-fixable/284247103-META.yml
+cpan/CPAN-Meta/t/data-fixable/344981821-META.yml
+cpan/CPAN-Meta/t/data-fixable/35478989-META.yml
+cpan/CPAN-Meta/t/data-fixable/98042513-META.yml
+cpan/CPAN-Meta/t/data-fixable/META-1_2.yml
+cpan/CPAN-Meta/t/data-fixable/META-1_3.yml
+cpan/CPAN-Meta/t/data-fixable/META-1_4.yml
+cpan/CPAN-Meta/t/data-fixable/META-2.json
+cpan/CPAN-Meta/t/data-fixable/invalid-meta-spec-version.json
+cpan/CPAN-Meta/t/data-fixable/invalid-meta-spec-version.yml
+cpan/CPAN-Meta/t/data-fixable/meta-spec-version-trailing-zeros.json
+cpan/CPAN-Meta/t/data-fixable/meta-spec-version-trailing-zeros.yml
+cpan/CPAN-Meta/t/data-fixable/restrictive-2.json
+cpan/CPAN-Meta/t/data-fixable/version-ranges-2.json
+cpan/CPAN-Meta/t/data-test/gpl-1_4.yml
+cpan/CPAN-Meta/t/data-test/META-1_0.yml
+cpan/CPAN-Meta/t/data-test/META-1_1.yml
+cpan/CPAN-Meta/t/data-test/META-1_2.yml
+cpan/CPAN-Meta/t/data-test/META-1_3.yml
+cpan/CPAN-Meta/t/data-test/META-1_4.yml
+cpan/CPAN-Meta/t/data-test/META-2.json
+cpan/CPAN-Meta/t/data-test/provides-version-missing.json
+cpan/CPAN-Meta/t/data-test/resources.yml
+cpan/CPAN-Meta/t/data-test/restricted-2.json
+cpan/CPAN-Meta/t/data-test/restrictive-1_4.yml
+cpan/CPAN-Meta/t/data-test/unicode.yml
+cpan/CPAN-Meta/t/data-test/version-not-normal.json
+cpan/CPAN-Meta/t/data-test/version-ranges-1_4.yml
+cpan/CPAN-Meta/t/data-test/version-ranges-2.json
+cpan/CPAN-Meta/t/data-valid/1122575719-META.yml
+cpan/CPAN-Meta/t/data-valid/1206545041-META.yml
+cpan/CPAN-Meta/t/data-valid/1985684504-META.yml
+cpan/CPAN-Meta/t/data-valid/476602558-META.yml
+cpan/CPAN-Meta/t/data-valid/META-1_0.yml
+cpan/CPAN-Meta/t/data-valid/META-1_1.yml
+cpan/CPAN-Meta/t/data-valid/scalar-meta-spec.yml
cpan/CPAN-Meta/t/load-bad.t
cpan/CPAN-Meta/t/meta-obj.t
cpan/CPAN-Meta/t/no-index.t
"perl5-porters@perl.org"
],
"dynamic_config" : 1,
- "generated_by" : "CPAN::Meta version 2.132661",
+ "generated_by" : "CPAN::Meta version 2.132830",
"license" : [
"perl_5"
],
- perl5-porters@perl.org
build_requires: {}
dynamic_config: 1
-generated_by: 'CPAN::Meta version 2.132661, CPAN::Meta::Converter version 2.132661'
+generated_by: 'CPAN::Meta version 2.132830, CPAN::Meta::Converter version 2.132830'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
# Note: When updating CPAN-Meta the META.* files will need to be regenerated
# perl -Icpan/CPAN-Meta/lib Porting/makemeta
'CPAN::Meta' => {
- 'DISTRIBUTION' => 'DAGOLDEN/CPAN-Meta-2.132661.tar.gz',
+ 'DISTRIBUTION' => 'DAGOLDEN/CPAN-Meta-2.132830.tar.gz',
'FILES' => q[cpan/CPAN-Meta],
'EXCLUDED' => [
qw(t/00-compile.t),
qw[t/00-report-prereqs.t],
+ qr{t/README-data.txt},
qr{^xt},
qr{^history},
],
Revision history for CPAN-Meta
+2.132830 2013-10-10 16:04:30 America/New_York
+
+ [ADDED]
+
+ - CPAN::Meta::Prereqs now has a 'merged_requirements' method for
+ combining requirements across multiple phases and types
+
+ [FIXED]
+
+ - Invalid 'meta-spec' is no longer a fatal error: instead, it will
+ usually be treated as spec version "1.0" (prior to formalization of the
+ meta-spec field). Conversion has some heuristics for guessing a
+ version depending on other fields if 'meta-spec' is missing or invalid.
+
2.132661 2013-09-23 13:27:46 America/New_York
[FIXED]
use strict;
use warnings;
package CPAN::Meta;
-our $VERSION = '2.132661'; # VERSION
+our $VERSION = '2.132830'; # VERSION
use Carp qw(carp croak);
=head1 VERSION
-version 2.132661
+version 2.132830
=head1 SYNOPSIS
will be converted to the version of the specification and returned. For
example:
- my $string = $meta->as_struct( {version => "1.4"} );
+ my $string = $meta->as_string( {version => "1.4"} );
For C<version> greater than or equal to 2, the string will be serialized as
JSON. For C<version> less than 2, the string will be serialized as YAML. In
=item *
+Chuck Adams <cja987@gmail.com>
+
+=item *
+
Cory G Watson <gphat@cpan.org>
=item *
=item *
-Olivier Mengué <dolmen@cpan.org>
+Olivier Mengue <dolmen@cpan.org>
=item *
use strict;
use warnings;
package CPAN::Meta::Converter;
-our $VERSION = '2.132661'; # VERSION
+our $VERSION = '2.132830'; # VERSION
use CPAN::Meta::Validator;
my $sig = __PACKAGE__ . " version " . (__PACKAGE__->VERSION || "<dev>");
return $sig unless defined $gen and length $gen;
- return $gen if $gen =~ /(, )\Q$sig/;
+ return $gen if $gen =~ /\Q$sig/;
return "$gen, $sig";
}
sub _change_meta_spec {
my ($element, undef, undef, $version) = @_;
- $element->{version} = $version;
- $element->{url} = $known_specs{$version};
- return $element;
+ return {
+ version => $version,
+ url => $known_specs{$version},
+ };
}
my @valid_licenses_1 = (
# create an attributes hash
my $self = {
'data' => $data,
- 'spec' => $data->{'meta-spec'}{'version'} || "1.0",
+ 'spec' => _extract_spec_version($data),
};
# create the object
return bless $self, $class;
}
+sub _extract_spec_version {
+ my ($data) = @_;
+ my $spec = $data->{'meta-spec'};
+
+ # is meta-spec there and valid?
+ return "1.0" unless defined $spec && ref $spec eq 'HASH'; # before meta-spec?
+
+ # does the version key look like a valid version?
+ my $v = $spec->{version};
+ if ( defined $v && $v =~ /^\d+(?:\.\d+)?$/ ) {
+ return $v if defined $v && grep { $v eq $_ } keys %known_specs; # known spec
+ return $v+0 if defined $v && grep { $v == $_ } keys %known_specs; # 2.0 => 2
+ }
+
+ # otherwise, use heuristics: look for 1.x vs 2.0 fields
+ return "2" if exists $data->{prereqs};
+ return "1.4" if exists $data->{configure_requires};
+ return "1.2"; # when meta-spec was first defined
+}
+
sub convert {
my ($self, %args) = @_;
=head1 VERSION
-version 2.132661
+version 2.132830
=head1 SYNOPSIS
use strict;
use warnings;
package CPAN::Meta::Feature;
-our $VERSION = '2.132661'; # VERSION
+our $VERSION = '2.132830'; # VERSION
use CPAN::Meta::Prereqs;
=head1 VERSION
-version 2.132661
+version 2.132830
=head1 DESCRIPTION
use strict;
use warnings;
package CPAN::Meta::History;
-our $VERSION = '2.132661'; # VERSION
+our $VERSION = '2.132830'; # VERSION
1;
=head1 VERSION
-version 2.132661
+version 2.132830
=head1 DESCRIPTION
use strict;
use warnings;
package CPAN::Meta::Prereqs;
-our $VERSION = '2.132661'; # VERSION
+our $VERSION = '2.132830'; # VERSION
use Carp qw(confess);
}
+sub merged_requirements {
+ my ($self, $phases, $types) = @_;
+ $phases = [qw/runtime build test/] unless defined $phases;
+ $types = [qw/requires recommends/] unless defined $types;
+
+ confess "merged_requirements phases argument must be an arrayref"
+ unless ref $phases eq 'ARRAY';
+ confess "merged_requirements types argument must be an arrayref"
+ unless ref $types eq 'ARRAY';
+
+ my $req = CPAN::Meta::Requirements->new;
+
+ for my $phase ( @$phases ) {
+ unless ($phase =~ /\Ax_/i or grep { $phase eq $_ } $self->__legal_phases) {
+ confess "requested requirements for unknown phase: $phase";
+ }
+ for my $type ( @$types ) {
+ unless ($type =~ /\Ax_/i or grep { $type eq $_ } $self->__legal_types) {
+ confess "requested requirements for unknown type: $type";
+ }
+ $req->add_requirements( $self->requirements_for($phase, $type) );
+ }
+ }
+
+ $req->finalize if $self->is_finalized;
+
+ return $req;
+}
+
+
+
sub as_string_hash {
my ($self) = @_;
=head1 VERSION
-version 2.132661
+version 2.132830
=head1 DESCRIPTION
The new prereqs object has no ties to the originals, and altering it further
will not alter them.
+=head2 merged_requirements
+
+ my $new_reqs = $prereqs->merged_requirements( \@phases, \@types );
+ my $new_reqs = $prereqs->merged_requirements( \@phases );
+ my $new_reqs = $preerqs->merged_requirements();
+
+This method joins together all requirements across a number of phases
+and types into a new L<CPAN::Meta::Requirements> object. If arguments
+are omitted, it defaults to "runtime", "build" and "test" for phases
+and "requires" and "recommends" for types.
+
=head2 as_string_hash
This method returns a hashref containing structures suitable for dumping into a
use strict;
use warnings;
package CPAN::Meta::Spec;
-our $VERSION = '2.132661'; # VERSION
+our $VERSION = '2.132830'; # VERSION
1;
=head1 VERSION
-version 2.132661
+version 2.132830
=head1 SYNOPSIS
use strict;
use warnings;
package CPAN::Meta::Validator;
-our $VERSION = '2.132661'; # VERSION
+our $VERSION = '2.132830'; # VERSION
#--------------------------------------------------------------------------#
# create an attributes hash
my $self = {
'data' => $data,
- 'spec' => $data->{'meta-spec'}{'version'} || "1.0",
+ 'spec' => eval { $data->{'meta-spec'}{'version'} } || "1.0",
'errors' => undef,
};
=head1 VERSION
-version 2.132661
+version 2.132830
=head1 SYNOPSIS
delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
-my $data_dir = IO::Dir->new( 't/data-bad' );
-my @files = sort grep { /^\w/ } $data_dir->read;
+my @data_dirs = qw( t/data-valid t/data-fixable );
+my @files = sort map {
+ my $d = $_;
+ map { "$d/$_" } grep { substr($_,0,1) ne '.' } IO::Dir->new($d)->read
+} @data_dirs;
-sub _spec_version { return $_[0]->{'meta-spec'}{version} || "1.0" }
+*_spec_version = \&CPAN::Meta::Converter::_extract_spec_version;
#use Data::Dumper;
for my $f ( reverse sort @files ) {
- my $path = File::Spec->catfile('t','data-bad',$f);
+ my $path = File::Spec->catfile($f);
my $original = Parse::CPAN::Meta->load_file( $path );
ok( $original, "loaded $f" );
my $original_v = _spec_version($original);
# UPCONVERSION
- if ( _spec_version( $original ) lt '2' ) {
+ if ( $original_v lt '2' ) {
my $cmc = CPAN::Meta::Converter->new( $original );
my $converted = $cmc->convert( version => 2 );
is ( _spec_version($converted), 2, "up converted spec version $original_v to spec version 2");
);
}
# UPCONVERSION - partial
- if ( _spec_version( $original ) lt '1.4' ) {
+ if ( $original_v lt '1.4' ) {
my $cmc = CPAN::Meta::Converter->new( $original );
my $converted = $cmc->convert( version => '1.4' );
is ( _spec_version($converted), 1.4, "up converted spec version $original_v to spec version 1.4");
);
}
# DOWNCONVERSION - partial
- if ( _spec_version( $original ) gt '1.2' ) {
+ if ( $original_v gt '1.2' ) {
my $cmc = CPAN::Meta::Converter->new( $original );
my $converted = $cmc->convert( version => '1.2' );
is ( _spec_version($converted), '1.2', "down converted spec version $original_v to spec version 1.2");
);
}
# DOWNCONVERSION
- if ( _spec_version( $original ) gt '1.0' ) {
+ if ( $original_v gt '1.0' ) {
my $cmc = CPAN::Meta::Converter->new( $original );
my $converted = $cmc->convert( version => '1.0' );
is ( _spec_version($converted), '1.0', "down converted spec version $original_v to spec version 1.0");
my $data_dir = IO::Dir->new( 't/data-fail' );
my @files = sort grep { /^\w/ } $data_dir->read;
-sub _spec_version { return $_[0]->{'meta-spec'}{version} || "1.0" }
+*_spec_version = \&CPAN::Meta::Converter::_extract_spec_version;
use Data::Dumper;
ok( $original, "loaded invalid $f" );
my $original_v = _spec_version($original);
# UPCONVERSION
- if ( _spec_version( $original ) lt '2' ) {
+ if ( $original_v lt '2' ) {
my $cmc = CPAN::Meta::Converter->new( $original );
- eval { $cmc->convert( version => 2 ) };
+ my $fixed = eval { $cmc->convert( version => 2 ) };
ok ( $@, "error thrown up converting" );
}
# DOWNCONVERSION
- if ( _spec_version( $original ) gt '1.0' ) {
+ if ( $original_v gt '1.0' ) {
my $cmc = CPAN::Meta::Converter->new( $original );
- eval { $cmc->convert( version => '1.0' ) };
+ my $fixed = eval { $cmc->convert( version => '1.0' ) };
ok ( $@, "error thrown down converting" );
}
}
package main;
-my $data_dir = IO::Dir->new( 't/data' );
+my $data_dir = IO::Dir->new( 't/data-test' );
my @files = sort grep { /^\w/ } $data_dir->read;
-sub _spec_version { return $_[0]->{'meta-spec'}{version} || "1.0" }
+*_spec_version = \&CPAN::Meta::Converter::_extract_spec_version;
#use Data::Dumper;
for my $f ( reverse sort @files ) {
- my $path = File::Spec->catfile('t','data',$f);
+ my $path = File::Spec->catfile('t','data-test',$f);
my $original = Parse::CPAN::Meta->load_file( $path );
ok( $original, "loaded $f" );
my $original_v = _spec_version($original);
# specific test for custom key handling
{
- my $path = File::Spec->catfile('t','data','META-1_4.yml');
+ my $path = File::Spec->catfile('t','data-test','META-1_4.yml');
my $original = Parse::CPAN::Meta->load_file( $path );
ok( $original, "loaded META-1_4.yml" );
my $cmc = CPAN::Meta::Converter->new( $original );
# specific test for custom key handling
{
- my $path = File::Spec->catfile('t','data','META-2.json');
+ my $path = File::Spec->catfile('t','data-test','META-2.json');
my $original = Parse::CPAN::Meta->load_file( $path );
ok( $original, "loaded META-2.json" );
my $cmc = CPAN::Meta::Converter->new( $original );
# specific test for generalization of unclear licenses
{
- my $path = File::Spec->catfile('t','data','gpl-1_4.yml');
+ my $path = File::Spec->catfile('t','data-test','gpl-1_4.yml');
my $original = Parse::CPAN::Meta->load_file( $path );
ok( $original, "loaded gpl-1_4.yml" );
my $cmc = CPAN::Meta::Converter->new( $original );
# specific test for upconverting resources
{
- my $path = File::Spec->catfile('t','data','resources.yml');
+ my $path = File::Spec->catfile('t','data-test','resources.yml');
my $original = Parse::CPAN::Meta->load_file( $path );
ok( $original, "loaded resources.yml" );
my $cmc = CPAN::Meta::Converter->new( $original );
# specific test for round-tripping resources
{
- my $path = File::Spec->catfile('t','data','resources.yml');
+ my $path = File::Spec->catfile('t','data-test','resources.yml');
my $original = Parse::CPAN::Meta->load_file( $path );
ok( $original, "loaded resources.yml" );
my $cmc1 = CPAN::Meta::Converter->new( $original );
# specific test for object conversion
{
- my $path = File::Spec->catfile('t','data','resources.yml');
+ my $path = File::Spec->catfile('t','data-test','resources.yml');
my $original = Parse::CPAN::Meta->load_file( $path );
ok( $original, "loaded resources.yml" );
$original->{version} = version->new("1.64");
# specific test for UTF-8 handling
{
- my $path = File::Spec->catfile('t','data','unicode.yml');
+ my $path = File::Spec->catfile('t','data-test','unicode.yml');
my $original = CPAN::Meta->load_file( $path )
or die "Couldn't load $path";
ok( $original, "unicode.yml" );
my $suffix = $case eq 2 ? "$case.json" : "$case.yml";
my $version = $case;
$version =~ tr[_][.];
- my $path = File::Spec->catfile('t','data','version-ranges-' . $suffix);
+ my $path = File::Spec->catfile('t','data-test','version-ranges-' . $suffix);
my $original = Parse::CPAN::Meta->load_file( $path );
ok( $original, "loaded " . basename $path );
my $cmc = CPAN::Meta::Converter->new( $original );
# specific test for version numbers
{
- my $path = File::Spec->catfile('t','data','version-not-normal.json');
+ my $path = File::Spec->catfile('t','data-test','version-not-normal.json');
my $original = Parse::CPAN::Meta->load_file( $path );
ok( $original, "loaded " . basename $path );
my $cmc = CPAN::Meta::Converter->new( $original );
# specific test for missing provides version
{
- my $path = File::Spec->catfile('t','data','provides-version-missing.json');
+ my $path = File::Spec->catfile('t','data-test','provides-version-missing.json');
my $original = Parse::CPAN::Meta->load_file( $path );
ok( $original, "loaded " . basename $path );
my $cmc = CPAN::Meta::Converter->new( $original );
--- /dev/null
+{
+ "resources" : {
+ "license" : [
+ "http://dev.perl.org/licenses/"
+ ],
+ "repository" : {
+ "url" : "svn://repo.example.com/foo-bar#fakeanchor",
+ "web" : "http://www.example.com"
+ }
+ },
+ "generated_by" : "Module::Build version 0.36",
+ "meta-spec" : {
+ "version" : "99",
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec"
+ },
+ "version" : "0.36",
+ "name" : "Module-Build",
+ "dynamic_config" : 1,
+ "author" : [
+ "Ken Williams <kwilliams@cpan.org>",
+ "Module-Build List <module-build@perl.org>"
+ ],
+ "release_status" : "stable",
+ "license" : [
+ "perl_5"
+ ],
+ "description" : "Module::Build is a system for building, testing, and installing Perl modules. It is meant to be an alternative to ExtUtils::MakeMaker... blah blah blah",
+ "keywords" : [
+ "toolchain",
+ "cpan",
+ "dual-life"
+ ],
+ "prereqs" : {
+ "runtime" : {
+ "requires" : {
+ "File::Copy" : "0",
+ "IO::File" : "0",
+ "Data::Dumper" : "0",
+ "File::Spec" : "0",
+ "Config" : "0",
+ "ExtUtils::Install" : "0",
+ "perl" : "5.006",
+ "File::Compare" : "0",
+ "File::Find" : "0",
+ "File::Path" : "0",
+ "File::Basename" : "0",
+ "Cwd" : "0"
+ },
+ "recommends" : {
+ "YAML" : "0.35",
+ "ExtUtils::ParseXS" : "2.02",
+ "Pod::Text" : "0",
+ "ExtUtils::Install" : "0.3",
+ "Archive::Tar" : "1.00"
+ }
+ },
+ "build" : {
+ "requires" : {
+ "Build::Requires": "1.1",
+ "Test::More" : "0"
+ }
+ },
+ "test" : {
+ "requires" : {
+ "Test::More" : "0.88",
+ "Test::Requires" : "1.2"
+ }
+ }
+ },
+ "optional_features" : {
+ "domination" : {
+ "prereqs" : {
+ "develop" : {
+ "requires" : {
+ "Genius::Evil" : "1.234"
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "Machine::Weather" : "2.0"
+ }
+ }
+ },
+ "description" : "Take over the world"
+ }
+ },
+ "abstract" : "Build and install Perl modules",
+ "x_whatever" : "Custom key"
+}
--- /dev/null
+---
+abstract: 'Build and install Perl modules'
+author:
+ - 'Ken Williams <kwilliams@cpan.org>'
+ - "Development questions, bug reports, and patches should be sent to the\nModule-Build mailing list at <module-build@perl.org>."
+build_requires:
+ File::Temp: 0.15
+ Test::Harness: 3.16
+ Test::More: 0.49
+generated_by: 'Module::Build version 0.3608'
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: X
+name: Module-Build
+provides:
+ Module::Build:
+ file: lib/Module/Build.pm
+ version: 0.36_08
+ Module::Build::Base:
+ file: lib/Module/Build/Base.pm
+ version: 0.36_08
+ Module::Build::Compat:
+ file: lib/Module/Build/Compat.pm
+ version: 0.36_08
+ Module::Build::Config:
+ file: lib/Module/Build/Config.pm
+ version: 0.36_08
+ Module::Build::Cookbook:
+ file: lib/Module/Build/Cookbook.pm
+ version: 0.36_08
+ Module::Build::Dumper:
+ file: lib/Module/Build/Dumper.pm
+ version: 0.36_08
+ Module::Build::ModuleInfo:
+ file: lib/Module/Build/ModuleInfo.pm
+ version: 0.36_08
+ Module::Build::Notes:
+ file: lib/Module/Build/Notes.pm
+ version: 0.36_08
+ Module::Build::PPMMaker:
+ file: lib/Module/Build/PPMMaker.pm
+ version: 0.36_08
+ Module::Build::Platform::Amiga:
+ file: lib/Module/Build/Platform/Amiga.pm
+ version: 0.36_08
+ Module::Build::Platform::Default:
+ file: lib/Module/Build/Platform/Default.pm
+ version: 0.36_08
+ Module::Build::Platform::EBCDIC:
+ file: lib/Module/Build/Platform/EBCDIC.pm
+ version: 0.36_08
+ Module::Build::Platform::MPEiX:
+ file: lib/Module/Build/Platform/MPEiX.pm
+ version: 0.36_08
+ Module::Build::Platform::MacOS:
+ file: lib/Module/Build/Platform/MacOS.pm
+ version: 0.36_08
+ Module::Build::Platform::RiscOS:
+ file: lib/Module/Build/Platform/RiscOS.pm
+ version: 0.36_08
+ Module::Build::Platform::Unix:
+ file: lib/Module/Build/Platform/Unix.pm
+ version: 0.36_08
+ Module::Build::Platform::VMS:
+ file: lib/Module/Build/Platform/VMS.pm
+ version: 0.36_08
+ Module::Build::Platform::VOS:
+ file: lib/Module/Build/Platform/VOS.pm
+ version: 0.36_08
+ Module::Build::Platform::Windows:
+ file: lib/Module/Build/Platform/Windows.pm
+ version: 0.36_08
+ Module::Build::Platform::aix:
+ file: lib/Module/Build/Platform/aix.pm
+ version: 0.36_08
+ Module::Build::Platform::cygwin:
+ file: lib/Module/Build/Platform/cygwin.pm
+ version: 0.36_08
+ Module::Build::Platform::darwin:
+ file: lib/Module/Build/Platform/darwin.pm
+ version: 0.36_08
+ Module::Build::Platform::os2:
+ file: lib/Module/Build/Platform/os2.pm
+ version: 0.36_08
+ Module::Build::PodParser:
+ file: lib/Module/Build/PodParser.pm
+ version: 0.36_08
+ Module::Build::Version:
+ file: lib/Module/Build/Version.pm
+ version: 0.77
+ Module::Build::YAML:
+ file: lib/Module/Build/YAML.pm
+ version: 1.40
+ inc::latest:
+ file: lib/inc/latest.pm
+ version: 0.36_08
+ inc::latest::private:
+ file: lib/inc/latest/private.pm
+ version: 0.36_08
+recommends:
+ ExtUtils::Install: 0.3
+ ExtUtils::Manifest: 1.54
+ version: 0.74
+requires:
+ Cwd: 0
+ Data::Dumper: 0
+ ExtUtils::CBuilder: 0.27
+ ExtUtils::Install: 0
+ ExtUtils::Manifest: 0
+ ExtUtils::Mkbootstrap: 0
+ ExtUtils::ParseXS: 2.21
+ File::Basename: 0
+ File::Compare: 0
+ File::Copy: 0
+ File::Find: 0
+ File::Path: 0
+ File::Spec: 0.82
+ Getopt::Long: 0
+ IO::File: 0
+ Test::Harness: 0
+ Text::Abbrev: 0
+ Text::ParseWords: 0
+ perl: 5.006001
+resources:
+ MailingList: mailto:module-build@perl.org
+ license: http://dev.perl.org/licenses/
+ repository: http://github.com/dagolden/module-build/
+version: 0.36_08
+x-whatever: this is a custom field
+x_whatelse: so is this
+XWhatNow: and this
--- /dev/null
+{
+ "resources" : {
+ "license" : [
+ "http://dev.perl.org/licenses/"
+ ],
+ "repository" : {
+ "url" : "svn://repo.example.com/foo-bar#fakeanchor",
+ "web" : "http://www.example.com"
+ }
+ },
+ "generated_by" : "Module::Build version 0.36",
+ "meta-spec" : {
+ "version" : "2.0",
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec"
+ },
+ "version" : "0.36",
+ "name" : "Module-Build",
+ "dynamic_config" : 1,
+ "author" : [
+ "Ken Williams <kwilliams@cpan.org>",
+ "Module-Build List <module-build@perl.org>"
+ ],
+ "release_status" : "stable",
+ "license" : [
+ "perl_5"
+ ],
+ "description" : "Module::Build is a system for building, testing, and installing Perl modules. It is meant to be an alternative to ExtUtils::MakeMaker... blah blah blah",
+ "keywords" : [
+ "toolchain",
+ "cpan",
+ "dual-life"
+ ],
+ "prereqs" : {
+ "runtime" : {
+ "requires" : {
+ "File::Copy" : "0",
+ "IO::File" : "0",
+ "Data::Dumper" : "0",
+ "File::Spec" : "0",
+ "Config" : "0",
+ "ExtUtils::Install" : "0",
+ "perl" : "5.006",
+ "File::Compare" : "0",
+ "File::Find" : "0",
+ "File::Path" : "0",
+ "File::Basename" : "0",
+ "Cwd" : "0"
+ },
+ "recommends" : {
+ "YAML" : "0.35",
+ "ExtUtils::ParseXS" : "2.02",
+ "Pod::Text" : "0",
+ "ExtUtils::Install" : "0.3",
+ "Archive::Tar" : "1.00"
+ }
+ },
+ "build" : {
+ "requires" : {
+ "Build::Requires": "1.1",
+ "Test::More" : "0"
+ }
+ },
+ "test" : {
+ "requires" : {
+ "Test::More" : "0.88",
+ "Test::Requires" : "1.2"
+ }
+ }
+ },
+ "optional_features" : {
+ "domination" : {
+ "prereqs" : {
+ "develop" : {
+ "requires" : {
+ "Genius::Evil" : "1.234"
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "Machine::Weather" : "2.0"
+ }
+ }
+ },
+ "description" : "Take over the world"
+ }
+ },
+ "abstract" : "Build and install Perl modules",
+ "x_whatever" : "Custom key"
+}
--- /dev/null
+---
+abstract: 'Build and install Perl modules'
+author:
+ - 'Ken Williams <kwilliams@cpan.org>'
+ - "Development questions, bug reports, and patches should be sent to the\nModule-Build mailing list at <module-build@perl.org>."
+build_requires:
+ File::Temp: 0.15
+ Test::Harness: 3.16
+ Test::More: 0.49
+generated_by: 'Module::Build version 0.3608'
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.400
+name: Module-Build
+provides:
+ Module::Build:
+ file: lib/Module/Build.pm
+ version: 0.36_08
+ Module::Build::Base:
+ file: lib/Module/Build/Base.pm
+ version: 0.36_08
+ Module::Build::Compat:
+ file: lib/Module/Build/Compat.pm
+ version: 0.36_08
+ Module::Build::Config:
+ file: lib/Module/Build/Config.pm
+ version: 0.36_08
+ Module::Build::Cookbook:
+ file: lib/Module/Build/Cookbook.pm
+ version: 0.36_08
+ Module::Build::Dumper:
+ file: lib/Module/Build/Dumper.pm
+ version: 0.36_08
+ Module::Build::ModuleInfo:
+ file: lib/Module/Build/ModuleInfo.pm
+ version: 0.36_08
+ Module::Build::Notes:
+ file: lib/Module/Build/Notes.pm
+ version: 0.36_08
+ Module::Build::PPMMaker:
+ file: lib/Module/Build/PPMMaker.pm
+ version: 0.36_08
+ Module::Build::Platform::Amiga:
+ file: lib/Module/Build/Platform/Amiga.pm
+ version: 0.36_08
+ Module::Build::Platform::Default:
+ file: lib/Module/Build/Platform/Default.pm
+ version: 0.36_08
+ Module::Build::Platform::EBCDIC:
+ file: lib/Module/Build/Platform/EBCDIC.pm
+ version: 0.36_08
+ Module::Build::Platform::MPEiX:
+ file: lib/Module/Build/Platform/MPEiX.pm
+ version: 0.36_08
+ Module::Build::Platform::MacOS:
+ file: lib/Module/Build/Platform/MacOS.pm
+ version: 0.36_08
+ Module::Build::Platform::RiscOS:
+ file: lib/Module/Build/Platform/RiscOS.pm
+ version: 0.36_08
+ Module::Build::Platform::Unix:
+ file: lib/Module/Build/Platform/Unix.pm
+ version: 0.36_08
+ Module::Build::Platform::VMS:
+ file: lib/Module/Build/Platform/VMS.pm
+ version: 0.36_08
+ Module::Build::Platform::VOS:
+ file: lib/Module/Build/Platform/VOS.pm
+ version: 0.36_08
+ Module::Build::Platform::Windows:
+ file: lib/Module/Build/Platform/Windows.pm
+ version: 0.36_08
+ Module::Build::Platform::aix:
+ file: lib/Module/Build/Platform/aix.pm
+ version: 0.36_08
+ Module::Build::Platform::cygwin:
+ file: lib/Module/Build/Platform/cygwin.pm
+ version: 0.36_08
+ Module::Build::Platform::darwin:
+ file: lib/Module/Build/Platform/darwin.pm
+ version: 0.36_08
+ Module::Build::Platform::os2:
+ file: lib/Module/Build/Platform/os2.pm
+ version: 0.36_08
+ Module::Build::PodParser:
+ file: lib/Module/Build/PodParser.pm
+ version: 0.36_08
+ Module::Build::Version:
+ file: lib/Module/Build/Version.pm
+ version: 0.77
+ Module::Build::YAML:
+ file: lib/Module/Build/YAML.pm
+ version: 1.40
+ inc::latest:
+ file: lib/inc/latest.pm
+ version: 0.36_08
+ inc::latest::private:
+ file: lib/inc/latest/private.pm
+ version: 0.36_08
+recommends:
+ ExtUtils::Install: 0.3
+ ExtUtils::Manifest: 1.54
+ version: 0.74
+requires:
+ Cwd: 0
+ Data::Dumper: 0
+ ExtUtils::CBuilder: 0.27
+ ExtUtils::Install: 0
+ ExtUtils::Manifest: 0
+ ExtUtils::Mkbootstrap: 0
+ ExtUtils::ParseXS: 2.21
+ File::Basename: 0
+ File::Compare: 0
+ File::Copy: 0
+ File::Find: 0
+ File::Path: 0
+ File::Spec: 0.82
+ Getopt::Long: 0
+ IO::File: 0
+ Test::Harness: 0
+ Text::Abbrev: 0
+ Text::ParseWords: 0
+ perl: 5.006001
+resources:
+ MailingList: mailto:module-build@perl.org
+ license: http://dev.perl.org/licenses/
+ repository: http://github.com/dagolden/module-build/
+version: 0.36_08
+x-whatever: this is a custom field
+x_whatelse: so is this
+XWhatNow: and this
--- /dev/null
+# http://module-build.sourceforge.net/META-spec-new.html
+#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
+meta-spec: 1.1
+name: XML-Writer
+version: 0.600
+abstract: Easily generate well-formed, namespace-aware XML.
+authored_by:
+ - David Megginson <david@megginson.com>
+ - Ed Avis <ed@membled.com>
+ - Joseph Walton <joe@kafsemo.org>
+license: perl
+distribution_type: module
+installdirs: site
+
+build_requires:
+ perl: 5.006_000
+recommends:
+ perl: 5.008_001
+
+no_index:
+ package:
+ - XML::Writer::Namespaces
+
+dynamic_config: 0
+generated_by: Hand
delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
-my $data_dir = IO::Dir->new( 't/data-bad' );
+my $data_dir = IO::Dir->new( 't/data-fixable' );
my @files = sort grep { /^\w/ } $data_dir->read;
for my $f ( sort @files ) {
- my $path = File::Spec->catfile('t','data-bad',$f);
- my $meta = eval { CPAN::Meta->load_file( $path, { fix_errors => 1 } ) };
+ my $path = File::Spec->catfile('t','data-fixable',$f);
+ my $meta = eval { CPAN::Meta->load_file( $path ) };
ok( defined $meta, "load_file('$f')" ) or diag $@;
my $string = _slurp($path);
my $method = $path =~ /\.json/ ? "load_json_string" : "load_yaml_string";
->requirements_for(qw(runtime requires))
->add_minimum(Bar => '2.976');
+ $new_prereq
+ ->requirements_for(qw(test requires))
+ ->add_minimum(Baz => '3.1416');
+
+ $new_prereq
+ ->requirements_for(qw(build recommends))
+ ->add_minimum(Bar => '3.000');
+
+ my $expect = {
+ runtime => { requires => { Foo => '1.000', Bar => '2.976' } },
+ test => { requires => { Baz => '3.1416' } },
+ build => { recommends => { Bar => '3.000' } },
+ };
+
is_deeply(
$new_prereq->as_string_hash,
- { runtime => { requires => { Foo => '1.000', Bar => '2.976' } } },
+ $expect,
'we can accumulate new requirements on a prereq object',
);
+
+ my $merged_requires = {
+ Foo => '1.000',
+ Bar => '2.976',
+ Baz => '3.1416',
+ };
+
+ my $merged_all = {
+ Foo => '1.000',
+ Bar => '3.000',
+ Baz => '3.1416',
+ };
+
+ is_deeply(
+ $new_prereq->merged_requirements(
+ [qw/runtime test build/], [qw/requires/]
+ )->as_string_hash,
+ $merged_requires,
+ "we can merge requirements for phases/types"
+ );
+
+ is_deeply(
+ $new_prereq->merged_requirements->as_string_hash,
+ $merged_all,
+ "default merging is runtime/build/test for requires/recommends"
+ );
}
done_testing;
is($loaded->{name}, 'Module-Build', 'name correct');
-ok( $loaded = Parse::CPAN::Meta->load_file('t/data/META-1_4.yml'), 'load META-1.4' );
+ok( $loaded = Parse::CPAN::Meta->load_file('t/data-test/META-1_4.yml'), 'load META-1.4' );
is($loaded->{name}, 'Module-Build', 'name correct');
# Test saving with conversion
delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
{
- my $data_dir = IO::Dir->new( 't/data' );
- my @files = sort grep { /^\w/ } $data_dir->read;
+ my @data_dirs = qw( t/data-test t/data-valid );
+ my @files = sort map {
+ my $d = $_;
+ map { "$d/$_" } grep { substr($_,0,1) ne '.' } IO::Dir->new($d)->read
+ } @data_dirs;
for my $f ( @files ) {
- my $meta = Parse::CPAN::Meta->load_file( File::Spec->catfile('t','data',$f) );
+ my $meta = Parse::CPAN::Meta->load_file( File::Spec->catfile($f) );
my $cmv = CPAN::Meta::Validator->new({%$meta});
ok( $cmv->is_valid, "$f validates" )
or diag( "ERRORS:\n" . join( "\n", $cmv->errors ) );
}
{
- my $data_dir = IO::Dir->new( 't/data-fail' );
- my @files = sort grep { /^\w/ } $data_dir->read;
+ my @data_dirs = qw( t/data-fail t/data-fixable );
+ my @files = sort map {
+ my $d = $_;
+ map { "$d/$_" } grep { substr($_,0,1) ne '.' } IO::Dir->new($d)->read
+ } @data_dirs;
for my $f ( @files ) {
- my $meta = Parse::CPAN::Meta->load_file( File::Spec->catfile('t','data-fail',$f) );
+ my $meta = Parse::CPAN::Meta->load_file( File::Spec->catfile($f) );
my $cmv = CPAN::Meta::Validator->new({%$meta});
- ok( ! $cmv->is_valid, "invalid $f doesn't validate" );
+ ok( ! $cmv->is_valid, "$f shouldn't validate" );
}
}
=item *
+L<CPAN::Meta> has been upgraded from version 2.132661 to 2.132830.
+
+L<CPAN::Meta::Prereqs> now has a C<merged_requirements> method for combining
+requirements across multiple phases and types, and an invalid 'meta-spec' is no
+longer a fatal error.
+
+=item *
+
L<File::Temp> has been upgraded from version 0.2302 to 0.2304.
Required versions of other modules used are now listed more explicitly.