r30493 - in /trunk/libconfig-any-perl: Changes META.yml debian/changelog debian/control debian/copyright 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 05:07:46 UTC 2009


Author: rmayorga
Date: Fri Feb  6 05:06:59 2009
New Revision: 30493

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=30493
Log:
 * New upstream release
 * debian/control: update my email address

Modified:
    trunk/libconfig-any-perl/Changes
    trunk/libconfig-any-perl/META.yml
    trunk/libconfig-any-perl/debian/changelog
    trunk/libconfig-any-perl/debian/control
    trunk/libconfig-any-perl/debian/copyright
    trunk/libconfig-any-perl/lib/Config/Any.pm
    trunk/libconfig-any-perl/lib/Config/Any/JSON.pm
    trunk/libconfig-any-perl/lib/Config/Any/YAML.pm

Modified: trunk/libconfig-any-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/Changes?rev=30493&op=diff
==============================================================================
--- trunk/libconfig-any-perl/Changes (original)
+++ trunk/libconfig-any-perl/Changes Fri Feb  6 05:06:59 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: trunk/libconfig-any-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/META.yml?rev=30493&op=diff
==============================================================================
--- trunk/libconfig-any-perl/META.yml (original)
+++ trunk/libconfig-any-perl/META.yml Fri Feb  6 05:06:59 2009
@@ -20,4 +20,4 @@
   perl: 5.6.0
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.16
+version: 0.17

Modified: trunk/libconfig-any-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/debian/changelog?rev=30493&op=diff
==============================================================================
--- trunk/libconfig-any-perl/debian/changelog (original)
+++ trunk/libconfig-any-perl/debian/changelog Fri Feb  6 05:06:59 2009
@@ -1,3 +1,11 @@
+libconfig-any-perl (0.17-1) unstable; urgency=low
+
+  [ Rene Mayorga ]
+   * New upstream release
+   * debian/control: update my email address
+
+ -- Rene Mayorga <rmayorga at debian.org>  Thu, 05 Feb 2009 21:53:20 -0600
+
 libconfig-any-perl (0.16-1) unstable; urgency=low
 
   [ gregor herrmann ]

Modified: trunk/libconfig-any-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/debian/control?rev=30493&op=diff
==============================================================================
--- trunk/libconfig-any-perl/debian/control (original)
+++ trunk/libconfig-any-perl/debian/control Fri Feb  6 05:06:59 2009
@@ -10,7 +10,7 @@
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Krzysztof Krzyzaniak (eloy) <eloy at debian.org>,
  Damyan Ivanov <dmn at debian.org>, Gunnar Wolf <gwolf at debian.org>,
- Rene Mayorga <rmayorga at debian.org.sv>, Ansgar Burchardt <ansgar at 43-1.org>,
+ Rene Mayorga <rmayorga at debian.org>, Ansgar Burchardt <ansgar at 43-1.org>,
  gregor herrmann <gregoa at debian.org>
 Standards-Version: 3.8.0
 Homepage: http://search.cpan.org/dist/Config-Any/

Modified: trunk/libconfig-any-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/debian/copyright?rev=30493&op=diff
==============================================================================
--- trunk/libconfig-any-perl/debian/copyright (original)
+++ trunk/libconfig-any-perl/debian/copyright Fri Feb  6 05:06:59 2009
@@ -49,7 +49,7 @@
  © 2007, Damyan Ivanov <dmn at debian.org>,
  © 2007-2008 gregor herrmann <gregoa at debian.org>,
  © 2008, Gunnar Wolf <gwolf at debian.org>,
- © 2008, Rene Mayorga <rmayorga at debian.org.sv>,
+ © 2008, Rene Mayorga <rmayorga at debian.org>,
  © 2008, Ansgar Burchardt <ansgar at 43-1.org>
 License: GPL-1+ | Artistic
  It is assumed that all contributors release their work under the same terms

Modified: trunk/libconfig-any-perl/lib/Config/Any.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/lib/Config/Any.pm?rev=30493&op=diff
==============================================================================
--- trunk/libconfig-any-perl/lib/Config/Any.pm (original)
+++ trunk/libconfig-any-perl/lib/Config/Any.pm Fri Feb  6 05:06:59 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: trunk/libconfig-any-perl/lib/Config/Any/JSON.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/lib/Config/Any/JSON.pm?rev=30493&op=diff
==============================================================================
--- trunk/libconfig-any-perl/lib/Config/Any/JSON.pm (original)
+++ trunk/libconfig-any-perl/lib/Config/Any/JSON.pm Fri Feb  6 05:06:59 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: trunk/libconfig-any-perl/lib/Config/Any/YAML.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/lib/Config/Any/YAML.pm?rev=30493&op=diff
==============================================================================
--- trunk/libconfig-any-perl/lib/Config/Any/YAML.pm (original)
+++ trunk/libconfig-any-perl/lib/Config/Any/YAML.pm Fri Feb  6 05:06:59 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