r28013 - in /trunk/libconfig-json-perl: Changes MANIFEST META.yml Makefile.PL README debian/changelog lib/Config/JSON.pm t/Config.t
bricas-guest at users.alioth.debian.org
bricas-guest at users.alioth.debian.org
Wed Dec 10 14:54:38 UTC 2008
Author: bricas-guest
Date: Wed Dec 10 14:54:25 2008
New Revision: 28013
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=28013
Log:
New upstream release
Modified:
trunk/libconfig-json-perl/Changes
trunk/libconfig-json-perl/MANIFEST
trunk/libconfig-json-perl/META.yml
trunk/libconfig-json-perl/Makefile.PL
trunk/libconfig-json-perl/README
trunk/libconfig-json-perl/debian/changelog
trunk/libconfig-json-perl/lib/Config/JSON.pm
trunk/libconfig-json-perl/t/Config.t
Modified: trunk/libconfig-json-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-json-perl/Changes?rev=28013&op=diff
==============================================================================
--- trunk/libconfig-json-perl/Changes (original)
+++ trunk/libconfig-json-perl/Changes Wed Dec 10 14:54:25 2008
@@ -1,4 +1,11 @@
Revision history for Config-JSON
+
+1.3.1 Mon Dec 8 14:00:00 2008
+ fix: #41525 Cleaning up temporary directory
+ Throws a better error message when trying to access an element of an array using a multi-level directive.
+ Writes config file directives in alphabetical order for easier human reading.
+ Better handling of UTF-8 data in the config file.
+ Better version numbers on prereqs.
1.3.0 Tue Oct 28 23:00:00 2008
Rewrote includes to be much cleaner.
Modified: trunk/libconfig-json-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-json-perl/MANIFEST?rev=28013&op=diff
==============================================================================
--- trunk/libconfig-json-perl/MANIFEST (original)
+++ trunk/libconfig-json-perl/MANIFEST Wed Dec 10 14:54:25 2008
@@ -6,6 +6,9 @@
lib/Config/JSON.pm
t/00.load.t
t/Config.t
+t/Duplicate.t
+t/Include.t
+t/Wildcard.t
authors.t/perlcritic.t
authors.t/pod-coverage.t
authors.t/pod.t
Modified: trunk/libconfig-json-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-json-perl/META.yml?rev=28013&op=diff
==============================================================================
--- trunk/libconfig-json-perl/META.yml (original)
+++ trunk/libconfig-json-perl/META.yml Wed Dec 10 14:54:25 2008
@@ -1,16 +1,17 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Config::JSON
-version: 1.3.0
+version: 1.3.1
version_from: lib/Config/JSON.pm
installdirs: site
requires:
- List::Util: 0
- Class::InsideOut: 0
- JSON: 2.0
- Test::More: 0
- Test::Deep: 0
- File::Temp: 0
+ List::Util: 1.19
+ Class::InsideOut: 1.06
+ JSON: 2.12
+ Test::More: 0.7
+ Test::Deep: 0.095
+ File::Temp: 0.18
+ version: 0.7203
distribution_type: module
generated_by: ExtUtils::MakeMaker version 6.17
Modified: trunk/libconfig-json-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-json-perl/Makefile.PL?rev=28013&op=diff
==============================================================================
--- trunk/libconfig-json-perl/Makefile.PL (original)
+++ trunk/libconfig-json-perl/Makefile.PL Wed Dec 10 14:54:25 2008
@@ -9,13 +9,13 @@
ABSTRACT_FROM => 'lib/Config/JSON.pm',
PL_FILES => {},
PREREQ_PM => {
- 'List::Util' => 0,
- 'JSON' => 2.0,
- 'Class::InsideOut' => 0,
- 'Test::More' => 0,
- 'Test::Deep' => 0,
- 'File::Temp' => 0,
- 'version' => 0,
+ 'List::Util' => 1.19,
+ 'JSON' => 2.12,
+ 'Class::InsideOut' => 1.06,
+ 'Test::More' => 0.7,
+ 'Test::Deep' => 0.095,
+ 'File::Temp' => 0.18,
+ 'version' => 0.7203,
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Config-JSON-*' },
Modified: trunk/libconfig-json-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-json-perl/README?rev=28013&op=diff
==============================================================================
--- trunk/libconfig-json-perl/README (original)
+++ trunk/libconfig-json-perl/README Wed Dec 10 14:54:25 2008
@@ -1,4 +1,4 @@
-Config-JSON version 1.3.0
+Config-JSON version 1.3.1
A JSON based config file parser/writer.
@@ -18,12 +18,12 @@
JSON 2.0 or higher
List::Util
Class::InsideOut
+File::Temp
version
The following are only used for tests:
Test::More
Test::Deep
-File::Temp
COPYRIGHT AND LICENCE
Modified: trunk/libconfig-json-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-json-perl/debian/changelog?rev=28013&op=diff
==============================================================================
--- trunk/libconfig-json-perl/debian/changelog (original)
+++ trunk/libconfig-json-perl/debian/changelog Wed Dec 10 14:54:25 2008
@@ -1,9 +1,13 @@
-libconfig-json-perl (1.3.0-2) UNRELEASED; urgency=low
+libconfig-json-perl (1.3.1-1) UNRELEASED; urgency=low
+ [ gregor herrmann ]
* debian/control: Changed: Switched Vcs-Browser field to ViewSVN
(source stanza).
- -- gregor herrmann <gregoa at debian.org> Sun, 16 Nov 2008 20:40:52 +0100
+ [ Brian Cassidy ]
+ * New upstream release
+
+ -- Brian Cassidy <brian.cassidy at gmail.com> Wed, 10 Dec 2008 10:53:41 -0400
libconfig-json-perl (1.3.0-1) unstable; urgency=low
Modified: trunk/libconfig-json-perl/lib/Config/JSON.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-json-perl/lib/Config/JSON.pm?rev=28013&op=diff
==============================================================================
--- trunk/libconfig-json-perl/lib/Config/JSON.pm (original)
+++ trunk/libconfig-json-perl/lib/Config/JSON.pm Wed Dec 10 14:54:25 2008
@@ -8,7 +8,7 @@
use File::Temp qw/ tempfile /;
use JSON;
use List::Util;
-use version; our $VERSION = qv('1.3.0');
+use version; our $VERSION = qv('1.3.1');
use constant FILE_HEADER => "# config-file-type: JSON 1\n";
@@ -102,7 +102,10 @@
# look in this config
my $value = $config{id $self};
foreach my $part (split "/", $property) {
- $value = $value->{$part};
+ $value = eval{$value->{$part}};
+ if ($@) {
+ croak "Can't access $property. $@";
+ }
}
return $value if (defined $value);
@@ -142,7 +145,7 @@
close($FILE);
my $conf;
eval {
- $conf = JSON->new->relaxed(1)->decode($json);
+ $conf = JSON->new->relaxed->utf8->decode($json);
};
croak "Couldn't parse JSON in config file '$pathToFile'\n" unless ref $conf;
my $self = register($class);
@@ -220,22 +223,15 @@
my $realfile = $self->getFilePath;
# convert data to json
- my $json = JSON->new->pretty->encode($config{id $self});
+ my $json = JSON->new->pretty->utf8->canonical->encode($config{id $self});
# create a temporary config file
- my ($fh, $tempfile) = tempfile();
- close($fh);
- if (open(my $FILE,">", $tempfile)) {
- print $FILE FILE_HEADER."\n".$json;
- close($FILE);
- }
- else {
- croak "Can't write (".$realfile.") to temporary file (".$tempfile.")";
- }
+ my ($fh, $tempfile) = tempfile(UNLINK=>1);
+ print {$fh} FILE_HEADER."\n".$json;
+ close($fh);
# move the temp file over the top of the existing file
copy($tempfile, $realfile) or croak "Can't copy temporary file (".$tempfile.") to config file (".$realfile.")";
- unlink $tempfile or carp "Can't delete temporary config file (".$tempfile.")";
}
@@ -249,7 +245,7 @@
=head1 VERSION
-This document describes Config::JSON version 1.3.0
+This document describes Config::JSON version 1.3.1
=head1 SYNOPSIS
Modified: trunk/libconfig-json-perl/t/Config.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-json-perl/t/Config.t?rev=28013&op=diff
==============================================================================
--- trunk/libconfig-json-perl/t/Config.t (original)
+++ trunk/libconfig-json-perl/t/Config.t Wed Dec 10 14:54:25 2008
@@ -1,4 +1,4 @@
-use Test::More tests => 26;
+use Test::More tests => 28;
use lib '../lib';
use Test::Deep;
@@ -67,6 +67,8 @@
is( $config->get("this/that/scalar"), "foo", "get() multilevel");
is( ref $config->get("this/that/hash"), "HASH", "get() hash multilevel" );
is( ref $config->get("this/that/array"), "ARRAY", "get() array multilevel" );
+eval{$config->get("this/that/array/non-existant-element")};
+ok($@, "Throw an error when trying to access an element of an array.");
# set
$config->set('privateArray', ['a', 'b', 'c']);
@@ -75,6 +77,9 @@
is($config->get('cars/ford'), "mustang", 'set() multilevel non-exisistant');
$config->set('cars/ford', [qw( mustang pinto maverick )]);
cmp_bag($config->get('cars/ford'),[qw( mustang pinto maverick )], 'set() multilevel');
+my $reconfig = Config::JSON->new($filename);
+cmp_bag($config->get('cars/ford'),$reconfig->get('cars/ford'), 'set() multilevel after re-reading config file');
+
# delete
$config->delete("dsn");
More information about the Pkg-perl-cvs-commits
mailing list