diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/CPAN/Meta.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/CPAN/Meta.pm | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/Master/tlpkg/tlperl/lib/CPAN/Meta.pm b/Master/tlpkg/tlperl/lib/CPAN/Meta.pm index ef798559fb4..f8185983a42 100644 --- a/Master/tlpkg/tlperl/lib/CPAN/Meta.pm +++ b/Master/tlpkg/tlperl/lib/CPAN/Meta.pm @@ -2,10 +2,7 @@ use 5.006; use strict; use warnings; package CPAN::Meta; -BEGIN { - $CPAN::Meta::VERSION = '2.110440'; -} -# ABSTRACT: the distribution metadata for a CPAN dist +our $VERSION = '2.120630'; # VERSION use Carp qw(carp croak); @@ -13,7 +10,9 @@ use CPAN::Meta::Feature; use CPAN::Meta::Prereqs; use CPAN::Meta::Converter; use CPAN::Meta::Validator; -use Parse::CPAN::Meta 1.44 (); +use Parse::CPAN::Meta 1.4400 (); + +BEGIN { *_dclone = \&CPAN::Meta::Converter::_dclone } BEGIN { @@ -47,7 +46,7 @@ BEGIN { my $value = $_[0]{ $attr }; croak "$attr must be called in list context" unless wantarray; - return @{ Storable::dclone($value) } if ref $value; + return @{ _dclone($value) } if ref $value; return $value; }; } @@ -73,7 +72,7 @@ BEGIN { (my $subname = $attr) =~ s/-/_/; *$subname = sub { my $value = $_[0]{ $attr }; - return Storable::dclone($value) if $value; + return _dclone($value) if $value; return {}; }; } @@ -87,7 +86,7 @@ sub custom_keys { sub custom { my ($self, $attr) = @_; my $value = $self->{$attr}; - return Storable::dclone($value) if ref $value; + return _dclone($value) if ref $value; return $value; } @@ -215,7 +214,6 @@ sub save { } -# XXX Do we need this if we always upconvert? -- dagolden, 2010-04-14 sub meta_spec_version { my ($self) = @_; return $self->meta_spec->{version}; @@ -290,10 +288,7 @@ sub feature { sub as_struct { my ($self, $options) = @_; - my $backend = Parse::CPAN::Meta->json_backend(); - my $struct = $backend->new->decode( - $backend->new->convert_blessed->encode($self) - ); + my $struct = _dclone($self); if ( $options->{version} ) { my $cmc = CPAN::Meta::Converter->new( $struct ); $struct = $cmc->convert( version => $options->{version} ); @@ -308,7 +303,7 @@ sub as_string { my $version = $options->{version} || '2'; my $struct; - if ( $self->version ne $version ) { + if ( $self->meta_spec_version ne $version ) { my $cmc = CPAN::Meta::Converter->new( $self->as_struct ); $struct = $cmc->convert( version => $version ); } @@ -339,6 +334,8 @@ sub TO_JSON { 1; +# ABSTRACT: the distribution metadata for a CPAN dist + =pod @@ -349,7 +346,7 @@ CPAN::Meta - the distribution metadata for a CPAN dist =head1 VERSION -version 2.110440 +version 2.120630 =head1 SYNOPSIS @@ -644,6 +641,10 @@ particular keys may be retrieved with the C<custom> method. If a custom key refers to a data structure, a deep clone is returned. +=for Pod::Coverage TO_JSON abstract author authors custom custom_keys description dynamic_config +generated_by keywords license licenses meta_spec name no_index +optional_features prereqs provides release_status resources version + =head1 BUGS Please report any bugs or feature using the CPAN Request Tracker. @@ -667,6 +668,25 @@ L<CPAN::Meta::Validator> =back +=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan + +=head1 SUPPORT + +=head2 Bugs / Feature Requests + +Please report any bugs or feature requests through the issue tracker +at L<http://rt.cpan.org/Public/Dist/Display.html?Name=CPAN-Meta>. +You will be notified automatically of any progress on your issue. + +=head2 Source Code + +This is open source software. The code repository is available for +public review and contribution under the terms of the license. + +L<http://github.com/dagolden/cpan-meta> + + git clone git://github.com/dagolden/cpan-meta.git + =head1 AUTHORS =over 4 |