r59065 - in /branches/upstream/libcpan-meta-perl/current: ./ lib/CPAN/ lib/CPAN/Meta/ t/
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Tue Jun 8 16:18:41 UTC 2010
Author: gregoa
Date: Tue Jun 8 16:18:16 2010
New Revision: 59065
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=59065
Log:
[svn-upgrade] new version libcpan-meta-perl (2.101591)
Modified:
branches/upstream/libcpan-meta-perl/current/Changes
branches/upstream/libcpan-meta-perl/current/META.json
branches/upstream/libcpan-meta-perl/current/META.yml
branches/upstream/libcpan-meta-perl/current/Makefile.PL
branches/upstream/libcpan-meta-perl/current/README
branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta.pm
branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Converter.pm
branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Feature.pm
branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/History.pm
branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Prereqs.pm
branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Spec.pm
branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Validator.pm
branches/upstream/libcpan-meta-perl/current/t/meta-obj.t
Modified: branches/upstream/libcpan-meta-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/Changes?rev=59065&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/Changes (original)
+++ branches/upstream/libcpan-meta-perl/current/Changes Tue Jun 8 16:18:16 2010
@@ -1,4 +1,14 @@
Revision history for CPAN-Meta
+
+2.101591 2010-06-08 09:56:17 EST5EDT
+
+ - added 'as_struct' method to CPAN::Meta to get a deep copy of
+ the metadata hash_ref
+
+ - won't add an optional_features 'description' field if missing
+
+ - improved documentation of CPAN::Meta::Converter and how it deals
+ with bad/missing data
2.101590 2010-06-07 21:49:36 EST5EDT
Modified: branches/upstream/libcpan-meta-perl/current/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/META.json?rev=59065&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/META.json (original)
+++ branches/upstream/libcpan-meta-perl/current/META.json Tue Jun 8 16:18:16 2010
@@ -5,7 +5,7 @@
"Ricardo Signes <rjbs at cpan.org>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 4.101540, CPAN::Meta::Converter version 2.101580",
+ "generated_by" : "Dist::Zilla version 4.101540, CPAN::Meta::Converter version 2.101590",
"license" : [
"perl_5"
],
@@ -56,7 +56,7 @@
"web" : "http://github.com/dagolden/cpan-meta"
}
},
- "version" : "2.101590",
+ "version" : "2.101591",
"x_Dist_Zilla" : {
"plugins" : [
{
Modified: branches/upstream/libcpan-meta-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/META.yml?rev=59065&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/META.yml (original)
+++ branches/upstream/libcpan-meta-perl/current/META.yml Tue Jun 8 16:18:16 2010
@@ -12,7 +12,7 @@
configure_requires:
ExtUtils::MakeMaker: 6.31
dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.101540, CPAN::Meta::Converter version 2.101580'
+generated_by: 'Dist::Zilla version 4.101540, CPAN::Meta::Converter version 2.101590'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -33,7 +33,7 @@
version: 0.82
resources:
repository: http://github.com/dagolden/cpan-meta.git
-version: 2.101590
+version: 2.101591
x_Dist_Zilla:
plugins:
-
Modified: branches/upstream/libcpan-meta-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/Makefile.PL?rev=59065&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/Makefile.PL (original)
+++ branches/upstream/libcpan-meta-perl/current/Makefile.PL Tue Jun 8 16:18:16 2010
@@ -35,7 +35,7 @@
'autodie' => '0',
'version' => '0.82'
},
- 'VERSION' => '2.101590',
+ 'VERSION' => '2.101591',
'test' => {
'TESTS' => 't/*.t'
}
Modified: branches/upstream/libcpan-meta-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/README?rev=59065&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/README (original)
+++ branches/upstream/libcpan-meta-perl/current/README Tue Jun 8 16:18:16 2010
@@ -1,7 +1,7 @@
This archive contains the distribution CPAN-Meta,
-version 2.101590:
+version 2.101591:
the distribution metadata for a CPAN dist
Modified: branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta.pm?rev=59065&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta.pm (original)
+++ branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta.pm Tue Jun 8 16:18:16 2010
@@ -4,7 +4,7 @@
use autodie;
package CPAN::Meta;
BEGIN {
- $CPAN::Meta::VERSION = '2.101590';
+ $CPAN::Meta::VERSION = '2.101591';
}
# ABSTRACT: the distribution metadata for a CPAN dist
@@ -296,6 +296,12 @@
return CPAN::Meta::Feature->new($ident, $f);
}
+
+sub as_struct {
+ my ($self) = @_;
+ return Storable::dclone($self);
+}
+
1;
@@ -308,7 +314,7 @@
=head1 VERSION
-version 2.101590
+version 2.101591
=head1 SYNOPSIS
@@ -458,6 +464,17 @@
with the given identifier. If no feature with that identifier exists, an
exception will be raised.
+=head2 as_struct
+
+ my $copy = $meta->as_struct;
+
+This method returns a deep copy of the object's metadata as an unblessed has
+reference. This is useful for raw analysis or for passing to a converter
+object. For example:
+
+ my $cmc = CPAN::Meta::Converter->new( $meta->as_struct );
+ my $meta_1_4 = $cmc->convert( version => "1.4" );
+
=head1 STRING DATA
The following methods return a single value, which is the value for the
Modified: branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Converter.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Converter.pm?rev=59065&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Converter.pm (original)
+++ branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Converter.pm Tue Jun 8 16:18:16 2010
@@ -4,7 +4,7 @@
use autodie;
package CPAN::Meta::Converter;
BEGIN {
- $CPAN::Meta::Converter::VERSION = '2.101590';
+ $CPAN::Meta::Converter::VERSION = '2.101591';
}
# ABSTRACT: Convert CPAN distribution metadata structures
@@ -465,7 +465,7 @@
}
my $optional_features_2_spec = {
- description => \&_keep_or_unknown,
+ description => \&_keep,
prereqs => \&_cleanup_prereqs,
':custom' => \&_prefix_custom,
};
@@ -1243,7 +1243,7 @@
=head1 VERSION
-version 2.101590
+version 2.101591
=head1 SYNOPSIS
@@ -1275,33 +1275,58 @@
my $new_struct = $cmc->convert( version => "2" );
-Returns a new hash reference with the metadata converted to a
-different form.
-
-Valid parameters include:
-
-=over 4
-
-=item *
-
-version
-
-Indicates the desired specification version (e.g. "1.0", "1.1" ... "1.4", "2").
-Defaults to the latest version of the CPAN Meta Spec.
-
-=back
-
-The conversion process attempts to clean-up simple errors and standardize data
-during converstion. For example, if C<author> is given as a scalar, it will
-converted to an array reference containing the item, or if a mandatory
-C<license> field is missing, it will be added as "unknown".
-
-Conversion proceeds through each version in turn. For example, a version 1.2
-structure is converted to 1.3 then 1.4 then finally version 2. Converting a
-structure to its own version will still clean-up and standardize the structure.
-
+Returns a new hash reference with the metadata converted to a different form.
C<convert> will die if any conversion/standardization still results in an
invalid structure.
+
+Valid parameters include:
+
+=over
+
+=item *
+
+C<version> -- Indicates the desired specification version (e.g. "1.0", "1.1" ... "1.4", "2").
+Defaults to the latest version of the CPAN Meta Spec.
+
+=back
+
+Conversion proceeds through each version in turn. For example, a version 1.2
+structure might be converted to 1.3 then 1.4 then finally to version 2. The
+conversion process attempts to clean-up simple errors and standardize data.
+For example, if C<author> is given as a scalar, it will converted to an array
+reference containing the item. (Converting a structure to its own version will
+also clean-up and standardize.)
+
+When data are cleaned and standardized, missing or invalid fields will be
+replaced with sensible defaults when possible. This may be lossy or imprecise.
+For example, some badly structured META.yml files on CPAN have prerequisite
+modules listed as both keys and values:
+
+ requires => { 'Foo::Bar' => 'Bam::Baz' }
+
+These would be split and each converted to a prerequisite with a minimum
+version of zero.
+
+When some mandatory fields are missing or invalid, the conversion will attempt
+to provide a sensible default or will fill them with a value of 'unknown'. For
+example a missing or unrecognized C<license> field will result in a C<license>
+field of 'unknown'. Fields that may get an 'unknown' include:
+
+=over 4
+
+=item *
+
+abstract
+
+=item *
+
+author
+
+=item *
+
+license
+
+=back
=head1 BUGS
Modified: branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Feature.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Feature.pm?rev=59065&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Feature.pm (original)
+++ branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Feature.pm Tue Jun 8 16:18:16 2010
@@ -4,7 +4,7 @@
use autodie;
package CPAN::Meta::Feature;
BEGIN {
- $CPAN::Meta::Feature::VERSION = '2.101590';
+ $CPAN::Meta::Feature::VERSION = '2.101591';
}
# ABSTRACT: an optional feature provided by a CPAN distribution
@@ -44,7 +44,7 @@
=head1 VERSION
-version 2.101590
+version 2.101591
=head1 DESCRIPTION
Modified: branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/History.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/History.pm?rev=59065&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/History.pm (original)
+++ branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/History.pm Tue Jun 8 16:18:16 2010
@@ -5,7 +5,7 @@
use autodie;
package CPAN::Meta::History;
BEGIN {
- $CPAN::Meta::History::VERSION = '2.101590';
+ $CPAN::Meta::History::VERSION = '2.101591';
}
# ABSTRACT: history of CPAN Meta Spec changes
1;
@@ -21,7 +21,7 @@
=head1 VERSION
-version 2.101590
+version 2.101591
=head1 DESCRIPTION
Modified: branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Prereqs.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Prereqs.pm?rev=59065&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Prereqs.pm (original)
+++ branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Prereqs.pm Tue Jun 8 16:18:16 2010
@@ -4,7 +4,7 @@
use autodie;
package CPAN::Meta::Prereqs;
BEGIN {
- $CPAN::Meta::Prereqs::VERSION = '2.101590';
+ $CPAN::Meta::Prereqs::VERSION = '2.101591';
}
# ABSTRACT: a set of distribution prerequisites by phase and type
@@ -151,7 +151,7 @@
=head1 VERSION
-version 2.101590
+version 2.101591
=head1 DESCRIPTION
Modified: branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Spec.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Spec.pm?rev=59065&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Spec.pm (original)
+++ branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Spec.pm Tue Jun 8 16:18:16 2010
@@ -5,7 +5,7 @@
use autodie;
package CPAN::Meta::Spec;
BEGIN {
- $CPAN::Meta::Spec::VERSION = '2.101590';
+ $CPAN::Meta::Spec::VERSION = '2.101591';
}
# ABSTRACT: specification for CPAN distribution metadata
1;
@@ -21,7 +21,7 @@
=head1 VERSION
-version 2.101590
+version 2.101591
=head1 SYNOPSIS
Modified: branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Validator.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Validator.pm?rev=59065&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Validator.pm (original)
+++ branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Validator.pm Tue Jun 8 16:18:16 2010
@@ -4,7 +4,7 @@
use autodie;
package CPAN::Meta::Validator;
BEGIN {
- $CPAN::Meta::Validator::VERSION = '2.101590';
+ $CPAN::Meta::Validator::VERSION = '2.101591';
}
# ABSTRACT: validate CPAN distribution metadata structures
@@ -841,7 +841,7 @@
=head1 VERSION
-version 2.101590
+version 2.101591
=head1 SYNOPSIS
Modified: branches/upstream/libcpan-meta-perl/current/t/meta-obj.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/t/meta-obj.t?rev=59065&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/t/meta-obj.t (original)
+++ branches/upstream/libcpan-meta-perl/current/t/meta-obj.t Tue Jun 8 16:18:16 2010
@@ -72,7 +72,10 @@
my $meta = CPAN::Meta->new($distmeta);
-isnt( $meta->resources, $meta->{resources}, "map values are deep cloned");
+is_deeply( $meta->as_struct, $distmeta, "->as_struct (deep comparison)" );
+isnt( $meta->as_struct, $distmeta, "->as_struct (is a deep clone)" );
+
+isnt( $meta->resources, $meta->{resources}, "->resource (map values are deep cloned)");
is($meta->name, 'Module-Build', '->name');
is($meta->abstract, 'Build and install Perl modules', '->abstract');
More information about the Pkg-perl-cvs-commits
mailing list