r13836 - in /branches/upstream/libconfig-any-perl/current: ./ lib/Config/ lib/Config/Any/ t/ t/conf/
gwolf at users.alioth.debian.org
gwolf at users.alioth.debian.org
Tue Jan 29 17:53:44 UTC 2008
Author: gwolf
Date: Tue Jan 29 17:53:44 2008
New Revision: 13836
URL: http://svn.debian.org/wsvn/?sc=1&rev=13836
Log:
[svn-upgrade] Integrating new upstream version, libconfig-any-perl (0.11)
Added:
branches/upstream/libconfig-any-perl/current/t/conf/subsections.ini
Modified:
branches/upstream/libconfig-any-perl/current/Changes
branches/upstream/libconfig-any-perl/current/MANIFEST
branches/upstream/libconfig-any-perl/current/META.yml
branches/upstream/libconfig-any-perl/current/README
branches/upstream/libconfig-any-perl/current/lib/Config/Any.pm
branches/upstream/libconfig-any-perl/current/lib/Config/Any/INI.pm
branches/upstream/libconfig-any-perl/current/lib/Config/Any/JSON.pm
branches/upstream/libconfig-any-perl/current/t/01-use.t
branches/upstream/libconfig-any-perl/current/t/10-branches.t
branches/upstream/libconfig-any-perl/current/t/50-general.t
branches/upstream/libconfig-any-perl/current/t/51-ini.t
branches/upstream/libconfig-any-perl/current/t/52-json.t
branches/upstream/libconfig-any-perl/current/t/53-perl.t
branches/upstream/libconfig-any-perl/current/t/54-xml.t
branches/upstream/libconfig-any-perl/current/t/55-yaml.t
branches/upstream/libconfig-any-perl/current/t/62-multi.t
branches/upstream/libconfig-any-perl/current/t/pod-coverage.t
branches/upstream/libconfig-any-perl/current/t/pod.t
Modified: branches/upstream/libconfig-any-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/Changes?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/Changes (original)
+++ branches/upstream/libconfig-any-perl/current/Changes Tue Jan 29 17:53:44 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: branches/upstream/libconfig-any-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/MANIFEST?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/MANIFEST (original)
+++ branches/upstream/libconfig-any-perl/current/MANIFEST Tue Jan 29 17:53:44 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: branches/upstream/libconfig-any-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/META.yml?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/META.yml (original)
+++ branches/upstream/libconfig-any-perl/current/META.yml Tue Jan 29 17:53:44 2008
@@ -17,4 +17,4 @@
- t
requires:
Module::Pluggable: 3.01
-version: 0.10
+version: 0.11
Modified: branches/upstream/libconfig-any-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/README?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/README (original)
+++ branches/upstream/libconfig-any-perl/current/README Tue Jan 29 17:53:44 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: branches/upstream/libconfig-any-perl/current/lib/Config/Any.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/lib/Config/Any.pm?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/lib/Config/Any.pm (original)
+++ branches/upstream/libconfig-any-perl/current/lib/Config/Any.pm Tue Jan 29 17:53:44 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: branches/upstream/libconfig-any-perl/current/lib/Config/Any/INI.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/lib/Config/Any/INI.pm?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/lib/Config/Any/INI.pm (original)
+++ branches/upstream/libconfig-any-perl/current/lib/Config/Any/INI.pm Tue Jan 29 17:53:44 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: branches/upstream/libconfig-any-perl/current/lib/Config/Any/JSON.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/lib/Config/Any/JSON.pm?rev=13836&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 Tue Jan 29 17:53:44 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: branches/upstream/libconfig-any-perl/current/t/01-use.t
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/t/01-use.t?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/t/01-use.t (original)
+++ branches/upstream/libconfig-any-perl/current/t/01-use.t Tue Jan 29 17:53:44 2008
@@ -1,3 +1,6 @@
+use strict;
+use warnings;
+
use Test::More tests => 6;
BEGIN {
Modified: branches/upstream/libconfig-any-perl/current/t/10-branches.t
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/t/10-branches.t?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/t/10-branches.t (original)
+++ branches/upstream/libconfig-any-perl/current/t/10-branches.t Tue Jan 29 17:53:44 2008
@@ -1,3 +1,6 @@
+use strict;
+use warnings;
+
use Test::More tests => 10;
use_ok( 'Config::Any' );
Modified: branches/upstream/libconfig-any-perl/current/t/50-general.t
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/t/50-general.t?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/t/50-general.t (original)
+++ branches/upstream/libconfig-any-perl/current/t/50-general.t Tue Jan 29 17:53:44 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: branches/upstream/libconfig-any-perl/current/t/51-ini.t
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/t/51-ini.t?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/t/51-ini.t (original)
+++ branches/upstream/libconfig-any-perl/current/t/51-ini.t Tue Jan 29 17:53:44 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: branches/upstream/libconfig-any-perl/current/t/52-json.t
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/t/52-json.t?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/t/52-json.t (original)
+++ branches/upstream/libconfig-any-perl/current/t/52-json.t Tue Jan 29 17:53:44 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: branches/upstream/libconfig-any-perl/current/t/53-perl.t
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/t/53-perl.t?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/t/53-perl.t (original)
+++ branches/upstream/libconfig-any-perl/current/t/53-perl.t Tue Jan 29 17:53:44 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: branches/upstream/libconfig-any-perl/current/t/54-xml.t
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/t/54-xml.t?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/t/54-xml.t (original)
+++ branches/upstream/libconfig-any-perl/current/t/54-xml.t Tue Jan 29 17:53:44 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: branches/upstream/libconfig-any-perl/current/t/55-yaml.t
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/t/55-yaml.t?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/t/55-yaml.t (original)
+++ branches/upstream/libconfig-any-perl/current/t/55-yaml.t Tue Jan 29 17:53:44 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: branches/upstream/libconfig-any-perl/current/t/62-multi.t
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/t/62-multi.t?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/t/62-multi.t (original)
+++ branches/upstream/libconfig-any-perl/current/t/62-multi.t Tue Jan 29 17:53:44 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;
Added: branches/upstream/libconfig-any-perl/current/t/conf/subsections.ini
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/t/conf/subsections.ini?rev=13836&op=file
==============================================================================
--- branches/upstream/libconfig-any-perl/current/t/conf/subsections.ini (added)
+++ branches/upstream/libconfig-any-perl/current/t/conf/subsections.ini Tue Jan 29 17:53:44 2008
@@ -1,0 +1,6 @@
+[section1]
+a = 1
+[section1 subsection1]
+b = 2
+[section1 subsection2]
+c = 3
Modified: branches/upstream/libconfig-any-perl/current/t/pod-coverage.t
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/t/pod-coverage.t?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/t/pod-coverage.t (original)
+++ branches/upstream/libconfig-any-perl/current/t/pod-coverage.t Tue Jan 29 17:53:44 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: branches/upstream/libconfig-any-perl/current/t/pod.t
URL: http://svn.debian.org/wsvn/branches/upstream/libconfig-any-perl/current/t/pod.t?rev=13836&op=diff
==============================================================================
--- branches/upstream/libconfig-any-perl/current/t/pod.t (original)
+++ branches/upstream/libconfig-any-perl/current/t/pod.t Tue Jan 29 17:53:44 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