r30491 - in /branches/upstream/libconfig-any-perl/current: Changes META.yml lib/Config/Any.pm lib/Config/Any/JSON.pm lib/Config/Any/YAML.pm

rmayorga at users.alioth.debian.org rmayorga at users.alioth.debian.org
Fri Feb 6 03:52:41 UTC 2009


Author: rmayorga
Date: Fri Feb  6 03:52:37 2009
New Revision: 30491

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=30491
Log:
[svn-upgrade] Integrating new upstream version, libconfig-any-perl (0.17)

Modified:
    branches/upstream/libconfig-any-perl/current/Changes
    branches/upstream/libconfig-any-perl/current/META.yml
    branches/upstream/libconfig-any-perl/current/lib/Config/Any.pm
    branches/upstream/libconfig-any-perl/current/lib/Config/Any/JSON.pm
    branches/upstream/libconfig-any-perl/current/lib/Config/Any/YAML.pm

Modified: branches/upstream/libconfig-any-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-any-perl/current/Changes?rev=30491&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/Changes (original)
+++ branches/upstream/libconfig-any-perl/current/Changes Fri Feb  6 03:52:37 2009
@@ -1,4 +1,8 @@
 Revision history for Config-Any
+
+0.17 Thu 05 Feb 2009
+    - ensure require() happens against plugin specified in force_plugins.
+    - add JSON::XS to the top of the JSON loaders list
 
 0.16 Mon 17 Nov 2008
     - fix up branches test which did not handle the errors thrown by

Modified: branches/upstream/libconfig-any-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-any-perl/current/META.yml?rev=30491&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/META.yml (original)
+++ branches/upstream/libconfig-any-perl/current/META.yml Fri Feb  6 03:52:37 2009
@@ -20,4 +20,4 @@
   perl: 5.6.0
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.16
+version: 0.17

Modified: branches/upstream/libconfig-any-perl/current/lib/Config/Any.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-any-perl/current/lib/Config/Any.pm?rev=30491&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/lib/Config/Any.pm (original)
+++ branches/upstream/libconfig-any-perl/current/lib/Config/Any.pm Fri Feb  6 03:52:37 2009
@@ -6,7 +6,7 @@
 use Carp;
 use Module::Pluggable::Object ();
 
-our $VERSION = '0.16';
+our $VERSION = '0.17';
 
 =head1 NAME
 
@@ -142,7 +142,9 @@
     }
 
     # figure out what plugins we're using
-    my @plugins = $force ? @{ $args->{ force_plugins } } : $class->plugins;
+    my @plugins = $force
+        ? map { eval "require $_;"; $_; } @{ $args->{ force_plugins } }
+        : $class->plugins;
 
     # map extensions if we have to
     my ( %extension_lut, $extension_re );

Modified: branches/upstream/libconfig-any-perl/current/lib/Config/Any/JSON.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-any-perl/current/lib/Config/Any/JSON.pm?rev=30491&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/lib/Config/Any/JSON.pm (original)
+++ branches/upstream/libconfig-any-perl/current/lib/Config/Any/JSON.pm Fri Feb  6 03:52:37 2009
@@ -49,25 +49,29 @@
     my $content = do { local $/; <$fh> };
     close $fh;
 
+    eval { require JSON::XS; };
+    unless( $@ ) {
+        return JSON::XS::decode_json( $content );
+    }
+
     eval { require JSON::Syck; };
-    if ( $@ ) {
-        require JSON;
-        eval { JSON->VERSION( 2 ); };
-        return $@ ? JSON::jsonToObj( $content ) : JSON::from_json( $content );
-    }
-    else {
+    unless( $@ ) {
         return JSON::Syck::Load( $content );
     }
+
+    require JSON;
+    eval { JSON->VERSION( 2 ); };
+    return $@ ? JSON::jsonToObj( $content ) : JSON::from_json( $content );
 }
 
 =head2 requires_any_of( )
 
-Specifies that this modules requires one of L<JSON::Syck> or L<JSON> in 
-order to work.
+Specifies that this modules requires one of,  L<JSON::XS>, L<JSON::Syck> or
+L<JSON> in order to work.
 
 =cut
 
-sub requires_any_of { 'JSON::Syck', 'JSON' }
+sub requires_any_of { 'JSON::XS', 'JSON::Syck', 'JSON' }
 
 =head1 AUTHOR
 
@@ -92,6 +96,8 @@
 
 =item * L<JSON::Syck>
 
+=item * L<JSON::XS>
+
 =back
 
 =cut

Modified: branches/upstream/libconfig-any-perl/current/lib/Config/Any/YAML.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-any-perl/current/lib/Config/Any/YAML.pm?rev=30491&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/lib/Config/Any/YAML.pm (original)
+++ branches/upstream/libconfig-any-perl/current/lib/Config/Any/YAML.pm Fri Feb  6 03:52:37 2009
@@ -44,16 +44,15 @@
     my $file  = shift;
 
     eval { require YAML::Syck; YAML::Syck->VERSION( '0.70' ) };
-    if ( $@ ) {
-        require YAML;
-        return YAML::LoadFile( $file );
-    }
-    else {
+    unless ( $@ ) {
         open( my $fh, $file ) or die $!;
         my $content = do { local $/; <$fh> };
         close $fh;
         return YAML::Syck::Load( $content );
     }
+
+    require YAML;
+    return YAML::LoadFile( $file );
 }
 
 =head2 requires_any_of( )




More information about the Pkg-perl-cvs-commits mailing list