[Catalyst-commits] r7438 - in trunk/Config-Any: . lib/Config
lib/Config/Any t t/conf
bricas at dev.catalyst.perl.org
bricas at dev.catalyst.perl.org
Thu Feb 7 23:01:10 GMT 2008
Author: bricas
Date: 2008-02-07 23:01:08 +0000 (Thu, 07 Feb 2008)
New Revision: 7438
Added:
trunk/Config-Any/t/63-invalid.t
trunk/Config-Any/t/conf/conf_invalid.pl
Modified:
trunk/Config-Any/Changes
trunk/Config-Any/lib/Config/Any.pm
trunk/Config-Any/lib/Config/Any/Perl.pm
Log:
remove eval so the Perl loader dies on invalid content.
Modified: trunk/Config-Any/Changes
===================================================================
--- trunk/Config-Any/Changes 2008-02-06 16:37:13 UTC (rev 7437)
+++ trunk/Config-Any/Changes 2008-02-07 23:01:08 UTC (rev 7438)
@@ -1,5 +1,8 @@
Revision history for Config-Any
+0.12 XXX 2008
+ - ensure Perl loader dies on a failed require() (RT #32995)
+
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
Modified: trunk/Config-Any/lib/Config/Any/Perl.pm
===================================================================
--- trunk/Config-Any/lib/Config/Any/Perl.pm 2008-02-06 16:37:13 UTC (rev 7437)
+++ trunk/Config-Any/lib/Config/Any/Perl.pm 2008-02-07 23:01:08 UTC (rev 7438)
@@ -47,7 +47,7 @@
my $content;
unless ( $content = $cache{ $file } ) {
- $content = eval { require $file };
+ $content = require $file;
$cache{ $file } = $content;
}
Modified: trunk/Config-Any/lib/Config/Any.pm
===================================================================
--- trunk/Config-Any/lib/Config/Any.pm 2008-02-06 16:37:13 UTC (rev 7437)
+++ trunk/Config-Any/lib/Config/Any.pm 2008-02-07 23:01:08 UTC (rev 7438)
@@ -6,7 +6,7 @@
use Carp;
use Module::Pluggable::Object ();
-our $VERSION = '0.11';
+our $VERSION = '0.12';
=head1 NAME
Added: trunk/Config-Any/t/63-invalid.t
===================================================================
--- trunk/Config-Any/t/63-invalid.t (rev 0)
+++ trunk/Config-Any/t/63-invalid.t 2008-02-07 23:01:08 UTC (rev 7438)
@@ -0,0 +1,14 @@
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+
+use Config::Any::Perl;
+
+{
+ my $file = 't/conf/conf_invalid.pl';
+ my $config = eval { Config::Any::Perl->load( $file ) };
+
+ ok( !$config, 'config load failed' );
+ ok( $@, "error thrown ($@)" );
+}
Added: trunk/Config-Any/t/conf/conf_invalid.pl
===================================================================
--- trunk/Config-Any/t/conf/conf_invalid.pl (rev 0)
+++ trunk/Config-Any/t/conf/conf_invalid.pl 2008-02-07 23:01:08 UTC (rev 7438)
@@ -0,0 +1 @@
+this is not valid perl.
More information about the Catalyst-commits
mailing list