r69220 - in /trunk/libparse-cpan-meta-perl: Changes META.yml Makefile.PL debian/changelog debian/control lib/Parse/CPAN/Meta.pm t/02_api.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Mon Feb 21 14:29:48 UTC 2011
Author: jawnsy-guest
Date: Mon Feb 21 14:29:39 2011
New Revision: 69220
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=69220
Log:
New upstream release
Modified:
trunk/libparse-cpan-meta-perl/Changes
trunk/libparse-cpan-meta-perl/META.yml
trunk/libparse-cpan-meta-perl/Makefile.PL
trunk/libparse-cpan-meta-perl/debian/changelog
trunk/libparse-cpan-meta-perl/debian/control
trunk/libparse-cpan-meta-perl/lib/Parse/CPAN/Meta.pm
trunk/libparse-cpan-meta-perl/t/02_api.t
Modified: trunk/libparse-cpan-meta-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libparse-cpan-meta-perl/Changes?rev=69220&op=diff
==============================================================================
--- trunk/libparse-cpan-meta-perl/Changes (original)
+++ trunk/libparse-cpan-meta-perl/Changes Mon Feb 21 14:29:39 2011
@@ -1,4 +1,11 @@
Changes for Perl programming language extension Parse-CPAN-Meta
+
+1.4401 Fri Feb 04 2011
+ - Removed Module::Load::Conditional dependency
+
+1.4400 Fri Feb 04 2011
+ - Added 'json_backend' and 'yaml_backend' methods to provide
+ the names of modules used for deserialization
1.4200 Mon Jan 24 2011
- No changes from 1.41_04
Modified: trunk/libparse-cpan-meta-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libparse-cpan-meta-perl/META.yml?rev=69220&op=diff
==============================================================================
--- trunk/libparse-cpan-meta-perl/META.yml (original)
+++ trunk/libparse-cpan-meta-perl/META.yml Mon Feb 21 14:29:39 2011
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Parse-CPAN-Meta
-version: 1.4200
+version: 1.4401
abstract: Parse META.yml and META.json CPAN metadata files
author:
- Adam Kennedy <adamk at cpan.org>
@@ -11,11 +11,10 @@
build_requires:
ExtUtils::MakeMaker: 0
requires:
- CPAN::Meta::YAML: 0.002
- File::Spec: 0.80
- JSON::PP: 2.27103
- Module::Load::Conditional: 0.26
- Test::More: 0.47
+ CPAN::Meta::YAML: 0.002
+ File::Spec: 0.80
+ JSON::PP: 2.27103
+ Test::More: 0.47
no_index:
directory:
- t
Modified: trunk/libparse-cpan-meta-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libparse-cpan-meta-perl/Makefile.PL?rev=69220&op=diff
==============================================================================
--- trunk/libparse-cpan-meta-perl/Makefile.PL (original)
+++ trunk/libparse-cpan-meta-perl/Makefile.PL Mon Feb 21 14:29:39 2011
@@ -9,7 +9,6 @@
'Test::More' => '0.47',
'JSON::PP' => 2.27103,
'CPAN::Meta::YAML' => '0.002',
- 'Module::Load::Conditional' => '0.26',
},
($] >= 5.005 ? (
AUTHOR => 'Adam Kennedy <adamk at cpan.org>',
Modified: trunk/libparse-cpan-meta-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libparse-cpan-meta-perl/debian/changelog?rev=69220&op=diff
==============================================================================
--- trunk/libparse-cpan-meta-perl/debian/changelog (original)
+++ trunk/libparse-cpan-meta-perl/debian/changelog Mon Feb 21 14:29:39 2011
@@ -1,4 +1,4 @@
-libparse-cpan-meta-perl (1.4200-1) UNRELEASED; urgency=low
+libparse-cpan-meta-perl (1.4401-1) UNRELEASED; urgency=low
WAITS-FOR: libjson-pp-perl etc
@@ -15,7 +15,10 @@
* Refreshed copyright using experimental dh-make-perl
* New upstream release
- -- Nicholas Bamber <nicholas at periapt.co.uk> Thu, 27 Jan 2011 21:27:55 +0000
+ [ Jonathan Yu ]
+ * New upstream release
+
+ -- Jonathan Yu <jawnsy at cpan.org> Mon, 21 Feb 2011 09:50:39 -0500
libparse-cpan-meta-perl (1.40-1) unstable; urgency=low
Modified: trunk/libparse-cpan-meta-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libparse-cpan-meta-perl/debian/control?rev=69220&op=diff
==============================================================================
--- trunk/libparse-cpan-meta-perl/debian/control (original)
+++ trunk/libparse-cpan-meta-perl/debian/control Mon Feb 21 14:29:39 2011
@@ -2,23 +2,27 @@
Section: perl
Priority: optional
Build-Depends: debhelper (>= 7)
-Build-Depends-Indep: perl, libtest-cpan-meta-perl (>= 0.12),
- libperl-minimumversion-perl (>= 1.20), libtest-minimumversion-perl (>= 0.008),
- libtest-pod-perl (>= 1.00), perl (>= 5.10.1) | libpod-simple-perl (>= 3.07),
+Build-Depends-Indep: perl,
+ libtest-cpan-meta-perl (>= 0.12),
+ libperl-minimumversion-perl (>= 1.20),
+ libtest-minimumversion-perl (>= 0.008),
+ libtest-pod-perl,
+ perl (>= 5.10.1) | libpod-simple-perl (>= 3.07),
libcpan-meta-yaml-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Vincent Danjean <vdanjean at debian.org>,
Brian Cassidy <brian.cassidy at gmail.com>, Jonathan Yu <jawnsy at cpan.org>,
gregor herrmann <gregoa at debian.org>, Ryan Niebur <ryan at debian.org>,
Damyan Ivanov <dmn at debian.org>, Nicholas Bamber <nicholas at periapt.co.uk>
-Standards-Version: 3.8.3
+Standards-Version: 3.9.1
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libparse-cpan-meta-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libparse-cpan-meta-perl/
Homepage: http://search.cpan.org/dist/Parse-CPAN-Meta/
Package: libparse-cpan-meta-perl
Architecture: all
-Depends: ${perl:Depends}, ${misc:Depends}, libcpan-meta-yaml-perl
+Depends: ${perl:Depends}, ${misc:Depends},
+ libcpan-meta-yaml-perl
Description: Module to parse META.yml and other similar CPAN metadata files
Parse::CPAN::Meta is a parser for META.yml files, based on the parser from
YAML::Tiny. Since the Tiny implementation supports a basic subset of the
Modified: trunk/libparse-cpan-meta-perl/lib/Parse/CPAN/Meta.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libparse-cpan-meta-perl/lib/Parse/CPAN/Meta.pm?rev=69220&op=diff
==============================================================================
--- trunk/libparse-cpan-meta-perl/lib/Parse/CPAN/Meta.pm (original)
+++ trunk/libparse-cpan-meta-perl/lib/Parse/CPAN/Meta.pm Mon Feb 21 14:29:39 2011
@@ -2,7 +2,6 @@
use strict;
use Carp 'croak';
-use Module::Load::Conditional qw/can_load/;
# UTF Support?
sub HAVE_UTF8 () { $] >= 5.007003 }
@@ -18,7 +17,7 @@
# Class structure
require 5.004;
require Exporter;
- $Parse::CPAN::Meta::VERSION = '1.4200';
+ $Parse::CPAN::Meta::VERSION = '1.4401';
@Parse::CPAN::Meta::ISA = qw{ Exporter };
@Parse::CPAN::Meta::EXPORT_OK = qw{ Load LoadFile };
}
@@ -39,7 +38,7 @@
sub load_yaml_string {
my ($class, $string) = @_;
- my $backend = _choose_yaml_backend();
+ my $backend = $class->yaml_backend();
my $data = eval { no strict 'refs'; &{"$backend\::Load"}($string) };
if ( $@ ) {
croak $backend->can('errstr') ? $backend->errstr : $@
@@ -49,19 +48,19 @@
sub load_json_string {
my ($class, $string) = @_;
- return _choose_json_backend()->new->decode($string);
-}
-
-sub _choose_yaml_backend {
+ return $class->json_backend()->new->decode($string);
+}
+
+sub yaml_backend {
local $Module::Load::Conditional::CHECK_INC_HASH = 1;
if (! defined $ENV{PERL_YAML_BACKEND} ) {
- can_load( modules => {'CPAN::Meta::YAML' => 0.002}, verbose => 0 )
+ _can_load( 'CPAN::Meta::YAML', 0.002 )
or croak "CPAN::Meta::YAML 0.002 is not available\n";
return "CPAN::Meta::YAML";
}
else {
my $backend = $ENV{PERL_YAML_BACKEND};
- can_load( modules => {$backend => undef}, verbose => 0 )
+ _can_load( $backend )
or croak "Could not load PERL_YAML_BACKEND '$backend'\n";
$backend->can("Load")
or croak "PERL_YAML_BACKEND '$backend' does not implement Load()\n";
@@ -69,15 +68,15 @@
}
}
-sub _choose_json_backend {
+sub json_backend {
local $Module::Load::Conditional::CHECK_INC_HASH = 1;
if (! $ENV{PERL_JSON_BACKEND} or $ENV{PERL_JSON_BACKEND} eq 'JSON::PP') {
- can_load( modules => {'JSON::PP' => 2.27103}, verbose => 0 )
+ _can_load( 'JSON::PP' => 2.27103 )
or croak "JSON::PP 2.27103 is not available\n";
return 'JSON::PP';
}
else {
- can_load( modules => {'JSON' => 2.5}, verbose => 0 )
+ _can_load( 'JSON' => 2.5 )
or croak "JSON 2.5 is required for " .
"\$ENV{PERL_JSON_BACKEND} = '$ENV{PERL_JSON_BACKEND}'\n";
return "JSON";
@@ -90,6 +89,21 @@
return do { local $/; <$fh> };
}
+sub _can_load {
+ my ($module, $version) = @_;
+ (my $file = $module) =~ s{::}{/}g;
+ $file .= ".pm";
+ return 1 if $INC{$file};
+ return 0 if exists $INC{$file}; # prior load failed
+ eval { require $file; 1 }
+ or return 0;
+ if ( defined $version ) {
+ eval { $module->VERSION($version); 1 }
+ or return 0;
+ }
+ return 1;
+}
+
# Kept for backwards compatibility only
# Create an object from a file
sub LoadFile ($) {
@@ -186,6 +200,22 @@
If the source was UTF-8 encoded, the string must be decoded before calling
C<load_json_string>.
+=head2 yaml_backend
+
+ my $backend = Parse::CPAN::Meta->yaml_backend;
+
+Returns the module name of the YAML serializer. See L</ENVIRONMENT>
+for details.
+
+=head2 json_backend
+
+ my $backend = Parse::CPAN::Meta->json_backend;
+
+Returns the module name of the JSON serializer. This will either
+be L<JSON::PP> or L<JSON>. Even if C<PERL_JSON_BACKEND> is set,
+this will return L<JSON> as further delegation is handled by
+the L<JSON> module. See L</ENVIRONMENT> for details.
+
=head1 FUNCTIONS
For maintenance clarity, no functions are exported. These functions are
Modified: trunk/libparse-cpan-meta-perl/t/02_api.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libparse-cpan-meta-perl/t/02_api.t?rev=69220&op=diff
==============================================================================
--- trunk/libparse-cpan-meta-perl/t/02_api.t (original)
+++ trunk/libparse-cpan-meta-perl/t/02_api.t Mon Feb 21 14:29:39 2011
@@ -62,6 +62,7 @@
{
local $ENV{PERL_YAML_BACKEND}; # ensure we get CPAN::META::YAML
+ is(Parse::CPAN::Meta->yaml_backend(), 'CPAN::Meta::YAML', 'yaml_backend()');
my $from_yaml = Parse::CPAN::Meta->load_file( $meta_yaml );
is_deeply($from_yaml, $want, "load from YAML file results in expected data");
}
@@ -79,6 +80,7 @@
unless eval "require YAML; 1";
local $ENV{PERL_YAML_BACKEND} = 'YAML';
+ is(Parse::CPAN::Meta->yaml_backend(), 'YAML', 'yaml_backend()');
my $yaml = load_ok( 'VR-META.yml', $meta_yaml, 100);
my $from_yaml = Parse::CPAN::Meta->load_yaml_string( $yaml );
is_deeply($from_yaml, $want, "load_yaml_string using PERL_YAML_BACKEND");
@@ -89,6 +91,7 @@
# JSON tests with JSON::PP
local $ENV{PERL_JSON_BACKEND}; # ensure we get JSON::PP
+ is(Parse::CPAN::Meta->json_backend(), 'JSON::PP', 'json_backend()');
my $from_json = Parse::CPAN::Meta->load_file( $meta_json );
is_deeply($from_json, $want, "load from JSON file results in expected data");
}
@@ -125,6 +128,7 @@
unless eval "require JSON; JSON->VERSION(2.5); 1";
local $ENV{PERL_JSON_BACKEND} = 1;
+ is(Parse::CPAN::Meta->json_backend(), 'JSON', 'json_backend()');
my $json = load_ok( 'VR-META.json', $meta_json, 100);
my $from_json = Parse::CPAN::Meta->load_json_string( $json );
is_deeply($from_json, $want, "load_json_string with PERL_JSON_BACKEND = 1");
More information about the Pkg-perl-cvs-commits
mailing list