r59067 - in /trunk/libcpan-meta-perl: ./ debian/ lib/CPAN/ lib/CPAN/Meta/ t/

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Tue Jun 8 16:21:58 UTC 2010


Author: gregoa
Date: Tue Jun  8 16:21:20 2010
New Revision: 59067

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=59067
Log:
* New upstream release 2.101591.

Modified:
    trunk/libcpan-meta-perl/Changes
    trunk/libcpan-meta-perl/META.json
    trunk/libcpan-meta-perl/META.yml
    trunk/libcpan-meta-perl/Makefile.PL
    trunk/libcpan-meta-perl/README
    trunk/libcpan-meta-perl/debian/changelog
    trunk/libcpan-meta-perl/lib/CPAN/Meta.pm
    trunk/libcpan-meta-perl/lib/CPAN/Meta/Converter.pm
    trunk/libcpan-meta-perl/lib/CPAN/Meta/Feature.pm
    trunk/libcpan-meta-perl/lib/CPAN/Meta/History.pm
    trunk/libcpan-meta-perl/lib/CPAN/Meta/Prereqs.pm
    trunk/libcpan-meta-perl/lib/CPAN/Meta/Spec.pm
    trunk/libcpan-meta-perl/lib/CPAN/Meta/Validator.pm
    trunk/libcpan-meta-perl/t/meta-obj.t

Modified: trunk/libcpan-meta-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcpan-meta-perl/Changes?rev=59067&op=diff
==============================================================================
--- trunk/libcpan-meta-perl/Changes (original)
+++ trunk/libcpan-meta-perl/Changes Tue Jun  8 16:21:20 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: trunk/libcpan-meta-perl/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcpan-meta-perl/META.json?rev=59067&op=diff
==============================================================================
--- trunk/libcpan-meta-perl/META.json (original)
+++ trunk/libcpan-meta-perl/META.json Tue Jun  8 16:21:20 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: trunk/libcpan-meta-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcpan-meta-perl/META.yml?rev=59067&op=diff
==============================================================================
--- trunk/libcpan-meta-perl/META.yml (original)
+++ trunk/libcpan-meta-perl/META.yml Tue Jun  8 16:21:20 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: trunk/libcpan-meta-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcpan-meta-perl/Makefile.PL?rev=59067&op=diff
==============================================================================
--- trunk/libcpan-meta-perl/Makefile.PL (original)
+++ trunk/libcpan-meta-perl/Makefile.PL Tue Jun  8 16:21:20 2010
@@ -35,7 +35,7 @@
     'autodie' => '0',
     'version' => '0.82'
   },
-  'VERSION' => '2.101590',
+  'VERSION' => '2.101591',
   'test' => {
     'TESTS' => 't/*.t'
   }

Modified: trunk/libcpan-meta-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcpan-meta-perl/README?rev=59067&op=diff
==============================================================================
--- trunk/libcpan-meta-perl/README (original)
+++ trunk/libcpan-meta-perl/README Tue Jun  8 16:21:20 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: trunk/libcpan-meta-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcpan-meta-perl/debian/changelog?rev=59067&op=diff
==============================================================================
--- trunk/libcpan-meta-perl/debian/changelog (original)
+++ trunk/libcpan-meta-perl/debian/changelog Tue Jun  8 16:21:20 2010
@@ -1,10 +1,14 @@
-libcpan-meta-perl (2.101590-1) unstable; urgency=low
+libcpan-meta-perl (2.101591-1) UNRELEASED; urgency=low
 
-  * New upstream release.
+  [ Ansgar Burchardt ]
+  * New upstream release 2.101590.
   * Add (build-)dep on libversion-perl (>= 1:0.8200) | perl (>= 5.12).
   * Drop patch spelling.patch: applied upstream.
 
- -- Ansgar Burchardt <ansgar at 43-1.org>  Wed, 09 Jun 2010 00:38:38 +0900
+  [ gregor herrmann ]
+  * New upstream release 2.101591.
+
+ -- gregor herrmann <gregoa at debian.org>  Tue, 08 Jun 2010 18:19:32 +0200
 
 libcpan-meta-perl (2.101461-1) unstable; urgency=low
 

Modified: trunk/libcpan-meta-perl/lib/CPAN/Meta.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcpan-meta-perl/lib/CPAN/Meta.pm?rev=59067&op=diff
==============================================================================
--- trunk/libcpan-meta-perl/lib/CPAN/Meta.pm (original)
+++ trunk/libcpan-meta-perl/lib/CPAN/Meta.pm Tue Jun  8 16:21:20 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: trunk/libcpan-meta-perl/lib/CPAN/Meta/Converter.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcpan-meta-perl/lib/CPAN/Meta/Converter.pm?rev=59067&op=diff
==============================================================================
--- trunk/libcpan-meta-perl/lib/CPAN/Meta/Converter.pm (original)
+++ trunk/libcpan-meta-perl/lib/CPAN/Meta/Converter.pm Tue Jun  8 16:21:20 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: trunk/libcpan-meta-perl/lib/CPAN/Meta/Feature.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcpan-meta-perl/lib/CPAN/Meta/Feature.pm?rev=59067&op=diff
==============================================================================
--- trunk/libcpan-meta-perl/lib/CPAN/Meta/Feature.pm (original)
+++ trunk/libcpan-meta-perl/lib/CPAN/Meta/Feature.pm Tue Jun  8 16:21:20 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: trunk/libcpan-meta-perl/lib/CPAN/Meta/History.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcpan-meta-perl/lib/CPAN/Meta/History.pm?rev=59067&op=diff
==============================================================================
--- trunk/libcpan-meta-perl/lib/CPAN/Meta/History.pm (original)
+++ trunk/libcpan-meta-perl/lib/CPAN/Meta/History.pm Tue Jun  8 16:21:20 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: trunk/libcpan-meta-perl/lib/CPAN/Meta/Prereqs.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcpan-meta-perl/lib/CPAN/Meta/Prereqs.pm?rev=59067&op=diff
==============================================================================
--- trunk/libcpan-meta-perl/lib/CPAN/Meta/Prereqs.pm (original)
+++ trunk/libcpan-meta-perl/lib/CPAN/Meta/Prereqs.pm Tue Jun  8 16:21:20 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: trunk/libcpan-meta-perl/lib/CPAN/Meta/Spec.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcpan-meta-perl/lib/CPAN/Meta/Spec.pm?rev=59067&op=diff
==============================================================================
--- trunk/libcpan-meta-perl/lib/CPAN/Meta/Spec.pm (original)
+++ trunk/libcpan-meta-perl/lib/CPAN/Meta/Spec.pm Tue Jun  8 16:21:20 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: trunk/libcpan-meta-perl/lib/CPAN/Meta/Validator.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcpan-meta-perl/lib/CPAN/Meta/Validator.pm?rev=59067&op=diff
==============================================================================
--- trunk/libcpan-meta-perl/lib/CPAN/Meta/Validator.pm (original)
+++ trunk/libcpan-meta-perl/lib/CPAN/Meta/Validator.pm Tue Jun  8 16:21:20 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: trunk/libcpan-meta-perl/t/meta-obj.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcpan-meta-perl/t/meta-obj.t?rev=59067&op=diff
==============================================================================
--- trunk/libcpan-meta-perl/t/meta-obj.t (original)
+++ trunk/libcpan-meta-perl/t/meta-obj.t Tue Jun  8 16:21:20 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