r13838 - in /trunk/libconfig-any-perl: ./ debian/ lib/Config/ lib/Config/Any/ t/ t/conf/
gwolf at users.alioth.debian.org
gwolf at users.alioth.debian.org
Tue Jan 29 18:03:21 UTC 2008
Author: gwolf
Date: Tue Jan 29 18:03:21 2008
New Revision: 13838
URL: http://svn.debian.org/wsvn/?sc=1&rev=13838
Log:
New upstream version
Added:
trunk/libconfig-any-perl/t/conf/subsections.ini
- copied unchanged from r13837, branches/upstream/libconfig-any-perl/current/t/conf/subsections.ini
Modified:
trunk/libconfig-any-perl/Changes
trunk/libconfig-any-perl/MANIFEST
trunk/libconfig-any-perl/META.yml
trunk/libconfig-any-perl/README
trunk/libconfig-any-perl/debian/changelog
trunk/libconfig-any-perl/debian/compat
trunk/libconfig-any-perl/debian/control
trunk/libconfig-any-perl/lib/Config/Any.pm
trunk/libconfig-any-perl/lib/Config/Any/INI.pm
trunk/libconfig-any-perl/lib/Config/Any/JSON.pm
trunk/libconfig-any-perl/t/01-use.t
trunk/libconfig-any-perl/t/10-branches.t
trunk/libconfig-any-perl/t/50-general.t
trunk/libconfig-any-perl/t/51-ini.t
trunk/libconfig-any-perl/t/52-json.t
trunk/libconfig-any-perl/t/53-perl.t
trunk/libconfig-any-perl/t/54-xml.t
trunk/libconfig-any-perl/t/55-yaml.t
trunk/libconfig-any-perl/t/62-multi.t
trunk/libconfig-any-perl/t/pod-coverage.t
trunk/libconfig-any-perl/t/pod.t
Modified: trunk/libconfig-any-perl/Changes
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/Changes?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/Changes (original)
+++ trunk/libconfig-any-perl/Changes Tue Jan 29 18:03:21 2008
@@ -1,4 +1,9 @@
Revision history for Config-Any
+
+0.11 Mon 28 Jan 2008
+ - fix subsection parsing for existing keys in INI files (RT #32726)
+ - use from_json() if JSON version 2.x is available
+ - refactor the test suite slightly
0.10 Tue 11 Dec 2007
- promote dev release to stable
Modified: trunk/libconfig-any-perl/MANIFEST
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/MANIFEST?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/MANIFEST (original)
+++ trunk/libconfig-any-perl/MANIFEST Tue Jan 29 18:03:21 2008
@@ -40,6 +40,7 @@
t/conf/conf.xml
t/conf/conf.yml
t/conf/conf2.ini
+t/conf/subsections.ini
t/multi/conf.yml
t/pod-coverage.t
t/pod.t
Modified: trunk/libconfig-any-perl/META.yml
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/META.yml?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/META.yml (original)
+++ trunk/libconfig-any-perl/META.yml Tue Jan 29 18:03:21 2008
@@ -17,4 +17,4 @@
- t
requires:
Module::Pluggable: 3.01
-version: 0.10
+version: 0.11
Modified: trunk/libconfig-any-perl/README
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/README?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/README (original)
+++ trunk/libconfig-any-perl/README Tue Jan 29 18:03:21 2008
@@ -1,9 +1,6 @@
NAME
Config::Any - Load configuration from different file formats,
transparently
-
-VERSION
- This document describes Config::Any version 0.10
SYNOPSIS
use Config::Any;
Modified: trunk/libconfig-any-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/debian/changelog?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/debian/changelog (original)
+++ trunk/libconfig-any-perl/debian/changelog Tue Jan 29 18:03:21 2008
@@ -1,8 +1,14 @@
-libconfig-any-perl (0.10-2) UNRELEASED; urgency=low
+libconfig-any-perl (0.11-1) unstable; urgency=low
+ [ gregor herrmann ]
* debian/rules: delete /usr/lib/perl5 only if it exists.
- -- gregor herrmann <gregor+debian at comodo.priv.at> Wed, 09 Jan 2008 21:17:05 +0100
+ [ Gunnar Wolf ]
+ * New upstream release
+ * Upgraded Debhelper compat level to 6
+ * Added myself as an uploader
+
+ -- Gunnar Wolf <gwolf at debian.org> Tue, 29 Jan 2008 11:55:37 -0600
libconfig-any-perl (0.10-1) unstable; urgency=low
Modified: trunk/libconfig-any-perl/debian/compat
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/debian/compat?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/debian/compat (original)
+++ trunk/libconfig-any-perl/debian/compat Tue Jan 29 18:03:21 2008
@@ -1,1 +1,1 @@
-5
+6
Modified: trunk/libconfig-any-perl/debian/control
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/debian/control?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/debian/control (original)
+++ trunk/libconfig-any-perl/debian/control Tue Jan 29 18:03:21 2008
@@ -1,11 +1,11 @@
Source: libconfig-any-perl
Section: perl
Priority: optional
-Build-Depends: debhelper (>= 5.0.0)
+Build-Depends: debhelper (>= 6.0.0)
Build-Depends-Indep: perl (>= 5.8.0-7), libmodule-build-perl, libmodule-pluggable-perl, libversion-perl, libtest-exception-perl, libtest-pod-perl, libtest-pod-coverage-perl, libjson-perl, libconfig-general-perl, libxml-simple-perl, libconfig-tiny-perl
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>
+ Damyan Ivanov <dmn at debian.org>, Gunnar Wolf <gwolf at debian.org>
Standards-Version: 3.7.3
Homepage: http://search.cpan.org/dist/Config-Any/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libconfig-any-perl/
Modified: trunk/libconfig-any-perl/lib/Config/Any.pm
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/lib/Config/Any.pm?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/lib/Config/Any.pm (original)
+++ trunk/libconfig-any-perl/lib/Config/Any.pm Tue Jan 29 18:03:21 2008
@@ -6,15 +6,11 @@
use Carp;
use Module::Pluggable::Object ();
-our $VERSION = '0.10';
+our $VERSION = '0.11';
=head1 NAME
Config::Any - Load configuration from different file formats, transparently
-
-=head1 VERSION
-
-This document describes Config::Any version 0.10
=head1 SYNOPSIS
Modified: trunk/libconfig-any-perl/lib/Config/Any/INI.pm
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/lib/Config/Any/INI.pm?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/lib/Config/Any/INI.pm (original)
+++ trunk/libconfig-any-perl/lib/Config/Any/INI.pm Tue Jan 29 18:03:21 2008
@@ -45,23 +45,21 @@
require Config::Tiny;
my $config = Config::Tiny->read( $file );
-
- my $main = delete $config->{ _ };
- my $out;
- $out->{ $_ } = $main->{ $_ } for keys %$main;
+ my $out = delete $config->{ _ } || {};
for my $k ( keys %$config ) {
- my @keys = split /\s+/, $k if $MAP_SECTION_SPACE_TO_NESTED_KEY;
+ my @keys = split /\s+/, $k;
my $ref = $config->{ $k };
- if ( @keys > 1 ) {
+ if ( $MAP_SECTION_SPACE_TO_NESTED_KEY && @keys > 1 ) {
my ( $a, $b ) = @keys[ 0, 1 ];
$out->{ $a }->{ $b } = $ref;
}
else {
- $out->{ $k } = $ref;
+ $out->{ $k } = { %{ $out->{ $k } || {} }, %$ref };
}
}
+
return $out;
}
Modified: trunk/libconfig-any-perl/lib/Config/Any/JSON.pm
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/lib/Config/Any/JSON.pm?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/lib/Config/Any/JSON.pm (original)
+++ trunk/libconfig-any-perl/lib/Config/Any/JSON.pm Tue Jan 29 18:03:21 2008
@@ -50,7 +50,8 @@
eval { require JSON::Syck; };
if ( $@ ) {
require JSON;
- return JSON::jsonToObj( $content );
+ eval { JSON->VERSION( 2 ); };
+ return $@ ? JSON::jsonToObj( $content ) : JSON::from_json( $content );
}
else {
return JSON::Syck::Load( $content );
Modified: trunk/libconfig-any-perl/t/01-use.t
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/t/01-use.t?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/01-use.t (original)
+++ trunk/libconfig-any-perl/t/01-use.t Tue Jan 29 18:03:21 2008
@@ -1,3 +1,6 @@
+use strict;
+use warnings;
+
use Test::More tests => 6;
BEGIN {
Modified: trunk/libconfig-any-perl/t/10-branches.t
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/t/10-branches.t?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/10-branches.t (original)
+++ trunk/libconfig-any-perl/t/10-branches.t Tue Jan 29 18:03:21 2008
@@ -1,3 +1,6 @@
+use strict;
+use warnings;
+
use Test::More tests => 10;
use_ok( 'Config::Any' );
Modified: trunk/libconfig-any-perl/t/50-general.t
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/t/50-general.t?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/50-general.t (original)
+++ trunk/libconfig-any-perl/t/50-general.t Tue Jan 29 18:03:21 2008
@@ -1,19 +1,25 @@
-use Test::More tests => 4;
+use strict;
+use warnings;
+use Test::More;
use Config::Any::General;
-my $config = eval { Config::Any::General->load( 't/conf/conf.conf' ) };
+if ( !Config::Any::General->is_supported ) {
+ plan skip_all => 'Config::General format not supported';
+}
+else {
+ plan tests => 4;
+}
-SKIP: {
- skip "Couldn't Load Config::General plugin", 4 if $@;
+{
+ my $config = Config::Any::General->load( 't/conf/conf.conf' );
ok( $config );
is( $config->{ name }, 'TestApp' );
ok( exists $config->{ Component } );
+}
- $config = eval {
- Config::Any::General->load( 't/conf/conf.conf',
- { -LowerCaseNames => 1 } );
- };
-
+{
+ my $config = Config::Any::General->load( 't/conf/conf.conf',
+ { -LowerCaseNames => 1 } );
ok( exists $config->{ component } );
}
Modified: trunk/libconfig-any-perl/t/51-ini.t
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/t/51-ini.t?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/51-ini.t (original)
+++ trunk/libconfig-any-perl/t/51-ini.t Tue Jan 29 18:03:21 2008
@@ -1,30 +1,48 @@
-use Test::More tests => 9;
+use strict;
+use warnings;
+use Test::More;
use Config::Any::INI;
-my $config = eval { Config::Any::INI->load( 't/conf/conf.ini' ) };
-my $simpleconfig = eval { Config::Any::INI->load( 't/conf/conf2.ini' ) };
+if ( !Config::Any::INI->is_supported ) {
+ plan skip_all => 'INI format not supported';
+}
+else {
+ plan tests => 11;
+}
-SKIP: {
- skip "Couldn't Load INI plugin", 6 if $@;
- ok( $config, "loaded INI config #1" );
+{
+ my $config = Config::Any::INI->load( 't/conf/conf.ini' );
+ ok( $config, 'config loaded' );
is( $config->{ name }, 'TestApp', "toplevel key lookup succeeded" );
- is( $config->{ Component }->{ Controller::Foo }->{ foo },
- 'bar', "nested hashref hack lookup succeeded" );
-
- ok( $simpleconfig, "loaded INI config #1" );
- is( $simpleconfig->{ name }, 'TestApp', "toplevel key lookup succeeded" );
- is( $simpleconfig->{ Controller::Foo }->{ foo },
+ is( $config->{ Component }->{ 'Controller::Foo' }->{ foo },
'bar', "nested hashref hack lookup succeeded" );
}
-$Config::Any::INI::MAP_SECTION_SPACE_TO_NESTED_KEY = 0;
-my $unspaced_config = eval { Config::Any::INI->load( 't/conf/conf.ini' ); };
-SKIP: {
- skip "Couldn't load INI plugin", 3 if $@;
- ok( $unspaced_config, "loaded INI config #1 in no-map-space mode" );
- is( $unspaced_config->{ name },
- 'TestApp', "toplevel key lookup succeeded" );
- is( $unspaced_config->{ 'Component Controller::Foo' }->{ foo },
+{
+ my $config = Config::Any::INI->load( 't/conf/conf2.ini' );
+ ok( $config, 'config loaded' );
+ is( $config->{ name }, 'TestApp', "toplevel key lookup succeeded" );
+ is( $config->{ 'Controller::Foo' }->{ foo },
+ 'bar', "nested hashref hack lookup succeeded" );
+}
+
+{
+ local $Config::Any::INI::MAP_SECTION_SPACE_TO_NESTED_KEY = 0;
+ my $config = Config::Any::INI->load( 't/conf/conf.ini' );
+ ok( $config, 'config loaded (no-map-space mode)' );
+ is( $config->{ name }, 'TestApp', "toplevel key lookup succeeded" );
+ is( $config->{ 'Component Controller::Foo' }->{ foo },
'bar', "unnested key lookup succeeded" );
}
+
+{
+ my $config = Config::Any::INI->load( 't/conf/subsections.ini' );
+
+ my %expected
+ = ( section1 =>
+ { a => 1, subsection1 => { b => 2 }, subsection2 => { c => 3 } }
+ );
+ ok( $config, 'config loaded' );
+ is_deeply( $config, \%expected, 'subsections parsed properly' );
+}
Modified: trunk/libconfig-any-perl/t/52-json.t
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/t/52-json.t?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/52-json.t (original)
+++ trunk/libconfig-any-perl/t/52-json.t Tue Jan 29 18:03:21 2008
@@ -1,11 +1,18 @@
-use Test::More tests => 2;
+use strict;
+use warnings;
+use Test::More;
use Config::Any::JSON;
-my $config = eval { Config::Any::JSON->load( 't/conf/conf.json' ) };
+if ( !Config::Any::JSON->is_supported ) {
+ plan skip_all => 'JSON format not supported';
+}
+else {
+ plan tests => 2;
+}
-SKIP: {
- skip "Couldn't Load JSON plugin", 2 if $@;
+{
+ my $config = Config::Any::JSON->load( 't/conf/conf.json' );
ok( $config );
is( $config->{ name }, 'TestApp' );
}
Modified: trunk/libconfig-any-perl/t/53-perl.t
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/t/53-perl.t?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/53-perl.t (original)
+++ trunk/libconfig-any-perl/t/53-perl.t Tue Jan 29 18:03:21 2008
@@ -1,17 +1,18 @@
+use strict;
+use warnings;
+
use Test::More tests => 3;
use Config::Any::Perl;
-my $file = 't/conf/conf.pl';
-my $config = eval { Config::Any::Perl->load( $file ) };
-
-SKIP: {
- skip "Couldn't Load Perl plugin", 3 if $@;
+{
+ my $file = 't/conf/conf.pl';
+ my $config = Config::Any::Perl->load( $file );
ok( $config );
is( $config->{ name }, 'TestApp' );
- my $config_2 = eval { Config::Any::Perl->load( $file ) };
+ my $config_load2 = Config::Any::Perl->load( $file );
+ is_deeply( $config_load2, $config, 'multiple loads of the same file' );
+}
- is_deeply( $config_2, $config, 'multiple loads of perl configs' );
-}
Modified: trunk/libconfig-any-perl/t/54-xml.t
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/t/54-xml.t?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/54-xml.t (original)
+++ trunk/libconfig-any-perl/t/54-xml.t Tue Jan 29 18:03:21 2008
@@ -1,11 +1,18 @@
-use Test::More tests => 2;
+use strict;
+use warnings;
+use Test::More;
use Config::Any::XML;
-my $config = eval { Config::Any::XML->load( 't/conf/conf.xml' ) };
+if ( !Config::Any::XML->is_supported ) {
+ plan skip_all => 'XML format not supported';
+}
+else {
+ plan tests => 2;
+}
-SKIP: {
- skip "Couldn't Load XML plugin", 2 if $@;
+{
+ my $config = Config::Any::XML->load( 't/conf/conf.xml' );
ok( $config );
is( $config->{ name }, 'TestApp' );
}
Modified: trunk/libconfig-any-perl/t/55-yaml.t
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/t/55-yaml.t?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/55-yaml.t (original)
+++ trunk/libconfig-any-perl/t/55-yaml.t Tue Jan 29 18:03:21 2008
@@ -1,11 +1,18 @@
-use Test::More tests => 2;
+use strict;
+use warnings;
+use Test::More;
use Config::Any::YAML;
-my $config = eval { Config::Any::YAML->load( 't/conf/conf.yml' ) };
+if ( !Config::Any::YAML->is_supported ) {
+ plan skip_all => 'YAML format not supported';
+}
+else {
+ plan tests => 2;
+}
-SKIP: {
- skip "Couldn't Load YAML plugin", 2 if $@;
+{
+ my $config = Config::Any::YAML->load( 't/conf/conf.yml' );
ok( $config );
is( $config->{ name }, 'TestApp' );
}
Modified: trunk/libconfig-any-perl/t/62-multi.t
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/t/62-multi.t?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/62-multi.t (original)
+++ trunk/libconfig-any-perl/t/62-multi.t Tue Jan 29 18:03:21 2008
@@ -1,7 +1,7 @@
-use Test::More tests => 3;
-
use strict;
use warnings;
+
+use Test::More tests => 3;
use Config::Any;
use Config::Any::YAML;
Modified: trunk/libconfig-any-perl/t/pod-coverage.t
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/t/pod-coverage.t?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/pod-coverage.t (original)
+++ trunk/libconfig-any-perl/t/pod-coverage.t Tue Jan 29 18:03:21 2008
@@ -1,7 +1,9 @@
-#!perl -T
+use strict;
+use warnings;
+use Test::More;
-use Test::More;
eval "use Test::Pod::Coverage 1.04";
+
plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage"
if $@;
all_pod_coverage_ok();
Modified: trunk/libconfig-any-perl/t/pod.t
URL: http://svn.debian.org/wsvn/trunk/libconfig-any-perl/t/pod.t?rev=13838&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/pod.t (original)
+++ trunk/libconfig-any-perl/t/pod.t Tue Jan 29 18:03:21 2008
@@ -1,6 +1,8 @@
-#!perl -T
+use strict;
+use warnings;
+use Test::More;
-use Test::More;
eval "use Test::Pod 1.14";
+
plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
all_pod_files_ok();
More information about the Pkg-perl-cvs-commits
mailing list