r26944 - in /trunk/libconfig-any-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/Config/ lib/Config/Any/ t/ t/conf/ t/lib/
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Sun Nov 16 12:51:30 UTC 2008
Author: ansgar-guest
Date: Sun Nov 16 12:51:26 2008
New Revision: 26944
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=26944
Log:
* New upstream release.
* Build-depend on libyaml-syck-perl | libyaml-perl to enable tests for
Config::Any::YAML.
* Add Recommends for libyaml-syck-perl | libyaml-perl as well.
* debian/copyright: Add information about lib/Config/Any/Base.pm.
Added:
trunk/libconfig-any-perl/lib/Config/Any/Base.pm
- copied unchanged from r26943, branches/upstream/libconfig-any-perl/current/lib/Config/Any/Base.pm
trunk/libconfig-any-perl/t/63-unsupported.t
- copied unchanged from r26943, branches/upstream/libconfig-any-perl/current/t/63-unsupported.t
trunk/libconfig-any-perl/t/64-extfail.t
- copied unchanged from r26943, branches/upstream/libconfig-any-perl/current/t/64-extfail.t
trunk/libconfig-any-perl/t/conf/conf.unsupported
- copied unchanged from r26943, branches/upstream/libconfig-any-perl/current/t/conf/conf.unsupported
trunk/libconfig-any-perl/t/lib/
- copied from r26943, branches/upstream/libconfig-any-perl/current/t/lib/
Modified:
trunk/libconfig-any-perl/Changes
trunk/libconfig-any-perl/MANIFEST
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/inc/Module/Install.pm
trunk/libconfig-any-perl/inc/Module/Install/AutoInstall.pm
trunk/libconfig-any-perl/inc/Module/Install/Base.pm
trunk/libconfig-any-perl/inc/Module/Install/Can.pm
trunk/libconfig-any-perl/inc/Module/Install/Fetch.pm
trunk/libconfig-any-perl/inc/Module/Install/Include.pm
trunk/libconfig-any-perl/inc/Module/Install/Makefile.pm
trunk/libconfig-any-perl/inc/Module/Install/Metadata.pm
trunk/libconfig-any-perl/inc/Module/Install/Win32.pm
trunk/libconfig-any-perl/inc/Module/Install/WriteAll.pm
trunk/libconfig-any-perl/lib/Config/Any.pm
trunk/libconfig-any-perl/lib/Config/Any/General.pm
trunk/libconfig-any-perl/lib/Config/Any/INI.pm
trunk/libconfig-any-perl/lib/Config/Any/JSON.pm
trunk/libconfig-any-perl/lib/Config/Any/Perl.pm
trunk/libconfig-any-perl/lib/Config/Any/XML.pm
trunk/libconfig-any-perl/lib/Config/Any/YAML.pm
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/61-features.t
Modified: trunk/libconfig-any-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/Changes?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/Changes (original)
+++ trunk/libconfig-any-perl/Changes Sun Nov 16 12:51:26 2008
@@ -1,4 +1,15 @@
Revision history for Config-Any
+
+0.15 Wed 12 Nov 2008
+ - when use_ext is true, we will check to see if there are no supported
+ modules for a particular file. instead of the file being skipped, an
+ error will be thrown (RT #38927).
+ - also, when use_ext is true, a fatal error will be thrown if there are
+ no loaders available that understand the file extension.
+ - officially support multiple loaders per extension
+ - add a Config::Any::Base for all loaders to inherit from, plus add
+ a new dependency mechanism: requires_any_of() and requires_all_of().
+ - filter out loaders that don't inherit from Config::Any::Base (RT #40830)
0.14 Wed 06 Aug 2008
- skip xml failure tests if XML::LibXML < 1.59 is installed, it seems
Modified: trunk/libconfig-any-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/MANIFEST?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/MANIFEST (original)
+++ trunk/libconfig-any-perl/MANIFEST Sun Nov 16 12:51:26 2008
@@ -11,6 +11,7 @@
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
lib/Config/Any.pm
+lib/Config/Any/Base.pm
lib/Config/Any/General.pm
lib/Config/Any/INI.pm
lib/Config/Any/JSON.pm
@@ -32,11 +33,14 @@
t/55-yaml.t
t/61-features.t
t/62-multi.t
+t/63-unsupported.t
+t/64-extfail.t
t/conf/conf.conf
t/conf/conf.foo
t/conf/conf.ini
t/conf/conf.json
t/conf/conf.pl
+t/conf/conf.unsupported
t/conf/conf.xml
t/conf/conf.yml
t/conf/conf2.ini
@@ -47,6 +51,7 @@
t/invalid/conf.pl
t/invalid/conf.xml
t/invalid/conf.yml
+t/lib/Config/Any/Unsupported.pm
t/multi/conf.yml
t/pod-coverage.t
t/pod.t
Modified: trunk/libconfig-any-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/META.yml?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/META.yml (original)
+++ trunk/libconfig-any-perl/META.yml Sun Nov 16 12:51:26 2008
@@ -5,7 +5,7 @@
build_requires:
Test::More: 0
distribution_type: module
-generated_by: 'Module::Install version 0.76'
+generated_by: 'Module::Install version 0.77'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -20,4 +20,4 @@
perl: 5.6.0
resources:
license: http://dev.perl.org/licenses/
-version: 0.14
+version: 0.15
Modified: trunk/libconfig-any-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/debian/changelog?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/debian/changelog (original)
+++ trunk/libconfig-any-perl/debian/changelog Sun Nov 16 12:51:26 2008
@@ -1,8 +1,16 @@
-libconfig-any-perl (0.14-2) UNRELEASED; urgency=low
+libconfig-any-perl (0.15-1) unstable; urgency=low
+ [ Tim Retout ]
* debian/copyright: Fix 'at your opinion' typo.
- -- Tim Retout <tim at retout.co.uk> Sun, 10 Aug 2008 15:52:13 -0300
+ [ Ansgar Burchardt ]
+ * New upstream release.
+ * Build-depend on libyaml-syck-perl | libyaml-perl to enable tests for
+ Config::Any::YAML.
+ * Add Recommends for libyaml-syck-perl | libyaml-perl as well.
+ * debian/copyright: Add information about lib/Config/Any/Base.pm.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org> Sun, 16 Nov 2008 13:51:04 +0100
libconfig-any-perl (0.14-1) unstable; urgency=low
Modified: trunk/libconfig-any-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/debian/control?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/debian/control (original)
+++ trunk/libconfig-any-perl/debian/control Sun Nov 16 12:51:26 2008
@@ -5,7 +5,8 @@
Build-Depends-Indep: perl (>= 5.8.0-7), libmodule-build-perl,
libmodule-pluggable-perl, perl-modules (>= 5.10) | libversion-perl,
libtest-exception-perl, libtest-pod-perl, libtest-pod-coverage-perl,
- libjson-perl, libconfig-general-perl, libxml-simple-perl, libconfig-tiny-perl
+ libjson-perl, libconfig-general-perl, libxml-simple-perl,
+ libconfig-tiny-perl, libyaml-syck-perl (>= 0.70) | libyaml-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>, Gunnar Wolf <gwolf at debian.org>,
@@ -20,7 +21,8 @@
Architecture: all
Depends: ${perl:Depends}, ${misc:Depends}, libmodule-pluggable-perl,
perl-modules (>= 5.10) | libversion-perl
-Recommends: libjson-perl, libconfig-general-perl, libxml-simple-perl, libconfig-tiny-perl
+Recommends: libjson-perl, libconfig-general-perl, libxml-simple-perl,
+ libconfig-tiny-perl, libyaml-syck-perl (>= 0.70) | libyaml-perl
Description: Load configuration from different file formats, transparently
Config::Any provides a facility for Perl applications and libraries to load
configuration data from multiple different file formats. It supports XML, YAML,
Modified: trunk/libconfig-any-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/debian/copyright?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/debian/copyright (original)
+++ trunk/libconfig-any-perl/debian/copyright Sun Nov 16 12:51:26 2008
@@ -31,9 +31,9 @@
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
-Files: lib/Config/Any/JSON.pm, lib/Config/Any/Perl.pm, lib/Config/Any/XML.pm,
- lib/Config/Any/YAML.pm
-Copyright: © 2007, Brian Cassidy
+Files: lib/Config/Any/Base.pm, lib/Config/Any/JSON.pm, lib/Config/Any/Perl.pm,
+ lib/Config/Any/XML.pm, lib/Config/Any/YAML.pm
+Copyright: © 2007-2008, Brian Cassidy
License: GPL-1+ | Artistic
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
Modified: trunk/libconfig-any-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/inc/Module/Install.pm?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/inc/Module/Install.pm (original)
+++ trunk/libconfig-any-perl/inc/Module/Install.pm Sun Nov 16 12:51:26 2008
@@ -30,7 +30,7 @@
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '0.76';
+ $VERSION = '0.77';
*inc::Module::Install::VERSION = *VERSION;
@inc::Module::Install::ISA = __PACKAGE__;
@@ -125,8 +125,10 @@
goto &$code unless $cwd eq $pwd;
}
$$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
- unshift @_, ( $self, $1 );
- goto &{$self->can('call')} unless uc($1) eq $1;
+ unless ( uc($1) eq $1 ) {
+ unshift @_, ( $self, $1 );
+ goto &{$self->can('call')};
+ }
};
}
@@ -339,6 +341,9 @@
close FH or die "close($_[0]): $!";
}
+# _version is for processing module versions (eg, 1.03_05) not
+# Perl versions (eg, 5.8.1).
+
sub _version ($) {
my $s = shift || 0;
$s =~ s/^(\d+)\.?//;
Modified: trunk/libconfig-any-perl/inc/Module/Install/AutoInstall.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/inc/Module/Install/AutoInstall.pm?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/inc/Module/Install/AutoInstall.pm (original)
+++ trunk/libconfig-any-perl/inc/Module/Install/AutoInstall.pm Sun Nov 16 12:51:26 2008
@@ -6,7 +6,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.76';
+ $VERSION = '0.77';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
Modified: trunk/libconfig-any-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/inc/Module/Install/Base.pm?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/inc/Module/Install/Base.pm (original)
+++ trunk/libconfig-any-perl/inc/Module/Install/Base.pm Sun Nov 16 12:51:26 2008
@@ -1,7 +1,7 @@
#line 1
package Module::Install::Base;
-$VERSION = '0.76';
+$VERSION = '0.77';
# Suspend handler for "redefined" warnings
BEGIN {
Modified: trunk/libconfig-any-perl/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/inc/Module/Install/Can.pm?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/inc/Module/Install/Can.pm (original)
+++ trunk/libconfig-any-perl/inc/Module/Install/Can.pm Sun Nov 16 12:51:26 2008
@@ -11,7 +11,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.76';
+ $VERSION = '0.77';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -39,6 +39,7 @@
return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
+ next if $dir eq '';
my $abs = File::Spec->catfile($dir, $_[1]);
return $abs if (-x $abs or $abs = MM->maybe_command($abs));
}
@@ -79,4 +80,4 @@
__END__
-#line 157
+#line 158
Modified: trunk/libconfig-any-perl/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/inc/Module/Install/Fetch.pm?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/libconfig-any-perl/inc/Module/Install/Fetch.pm Sun Nov 16 12:51:26 2008
@@ -6,7 +6,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.76';
+ $VERSION = '0.77';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
Modified: trunk/libconfig-any-perl/inc/Module/Install/Include.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/inc/Module/Install/Include.pm?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/inc/Module/Install/Include.pm (original)
+++ trunk/libconfig-any-perl/inc/Module/Install/Include.pm Sun Nov 16 12:51:26 2008
@@ -6,7 +6,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.76';
+ $VERSION = '0.77';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
Modified: trunk/libconfig-any-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/inc/Module/Install/Makefile.pm?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/libconfig-any-perl/inc/Module/Install/Makefile.pm Sun Nov 16 12:51:26 2008
@@ -7,7 +7,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.76';
+ $VERSION = '0.77';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -181,7 +181,9 @@
my $user_preop = delete $args{dist}->{PREOP};
if (my $preop = $self->admin->preop($user_preop)) {
- $args{dist} = $preop;
+ foreach my $key ( keys %$preop ) {
+ $args{dist}->{$key} = $preop->{$key};
+ }
}
my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
@@ -248,4 +250,4 @@
__END__
-#line 377
+#line 379
Modified: trunk/libconfig-any-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/inc/Module/Install/Metadata.pm?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/libconfig-any-perl/inc/Module/Install/Metadata.pm Sun Nov 16 12:51:26 2008
@@ -6,7 +6,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.76';
+ $VERSION = '0.77';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -175,6 +175,12 @@
my $version = shift or die(
"Did not provide a value to perl_version()"
);
+
+ # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
+ # numbers (eg, 5.006001 or 5.008009).
+
+ $version =~ s/^(\d+)\.(\d+)\.(\d+)$/sprintf("%d.%03d%03d",$1,$2,$3)/e;
+
$version =~ s/_.+$//;
$version = $version + 0; # Numify
unless ( $version >= 5.005 ) {
@@ -212,6 +218,9 @@
unless ( -e $file ) {
die("all_from cannot find $file from $name");
}
+ }
+ unless ( -f $file ) {
+ die("The path '$file' does not exist, or is not a file");
}
# Some methods pull from POD instead of code.
@@ -424,8 +433,12 @@
my $license_text = $1;
my @phrases = (
'under the same (?:terms|license) as perl itself' => 'perl', 1,
+ 'GNU general public license' => 'gpl', 1,
'GNU public license' => 'gpl', 1,
+ 'GNU lesser general public license' => 'lgpl', 1,
'GNU lesser public license' => 'lgpl', 1,
+ 'GNU library general public license' => 'lgpl', 1,
+ 'GNU library public license' => 'lgpl', 1,
'BSD license' => 'bsd', 1,
'Artistic license' => 'artistic', 1,
'GPL' => 'gpl', 1,
Modified: trunk/libconfig-any-perl/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/inc/Module/Install/Win32.pm?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/libconfig-any-perl/inc/Module/Install/Win32.pm Sun Nov 16 12:51:26 2008
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.76';
+ $VERSION = '0.77';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
Modified: trunk/libconfig-any-perl/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/inc/Module/Install/WriteAll.pm?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/libconfig-any-perl/inc/Module/Install/WriteAll.pm Sun Nov 16 12:51:26 2008
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.76';
+ $VERSION = '0.77';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
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=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/lib/Config/Any.pm (original)
+++ trunk/libconfig-any-perl/lib/Config/Any.pm Sun Nov 16 12:51:26 2008
@@ -6,7 +6,7 @@
use Carp;
use Module::Pluggable::Object ();
-our $VERSION = '0.14';
+our $VERSION = '0.15';
=head1 NAME
@@ -149,7 +149,10 @@
my $use_ext_lut = !$force && $args->{ use_ext };
if ( $use_ext_lut ) {
for my $plugin ( @plugins ) {
- $extension_lut{ $_ } = $plugin for $plugin->extensions;
+ for ( $plugin->extensions ) {
+ $extension_lut{ $_ } ||= [];
+ push @{ $extension_lut{ $_ } }, $plugin;
+ }
}
$extension_re = join( '|', keys %extension_lut );
@@ -174,12 +177,21 @@
if ( $use_ext_lut ) {
$filename =~ m{\.($extension_re)\z};
- next unless $1;
- @try_plugins = $extension_lut{ $1 };
- }
-
+
+ if( !$1 ) {
+ $filename =~ m{\.([^.]+)\z};
+ croak "There are no loaders available for .${1} files";
+ }
+
+ @try_plugins = @{ $extension_lut{ $1 } };
+ }
+
+ # not using use_ext means we try all plugins anyway, so we'll
+ # ignore it for the "unsupported" error
+ my $supported = $use_ext_lut ? 0 : 1;
for my $loader ( @try_plugins ) {
next unless $loader->is_supported;
+ $supported = 1;
my @configs
= eval { $loader->load( $filename, $loader_args{ $loader } ); };
@@ -196,6 +208,12 @@
{ $filename => @configs == 1 ? $configs[ 0 ] : \@configs };
last;
}
+
+ if ( !$supported ) {
+ croak
+ "Cannot load $filename: required support modules are not available.\nPlease install "
+ . join( " OR ", map { _support_error( $_ ) } @try_plugins );
+ }
}
if ( defined $args->{ flatten_to_hash } ) {
@@ -204,6 +222,17 @@
}
return \@results;
+}
+
+sub _support_error {
+ my $module = shift;
+ if ( $module->can( 'requires_all_of' ) ) {
+ return join( ' and ',
+ map { ref $_ ? join( ' ', @$_ ) : $_ } $module->requires_all_of );
+ }
+ if ( $module->can( 'requires_any_of' ) ) {
+ return 'one of ' . join( ' or ', $module->requires_any_of );
+ }
}
=head2 finder( )
@@ -219,6 +248,7 @@
my $class = shift;
my $finder = Module::Pluggable::Object->new(
search_path => [ __PACKAGE__ ],
+ except => [ __PACKAGE__ . '::Base' ],
require => 1
);
return $finder;
@@ -233,7 +263,8 @@
sub plugins {
my $class = shift;
- return $class->finder->plugins;
+ # filter out things that don't look like our plugins
+ return grep { $_->isa( 'Config::Any::Base' ) } $class->finder->plugins;
}
=head2 extensions( )
Modified: trunk/libconfig-any-perl/lib/Config/Any/General.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/lib/Config/Any/General.pm?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/lib/Config/Any/General.pm (original)
+++ trunk/libconfig-any-perl/lib/Config/Any/General.pm Sun Nov 16 12:51:26 2008
@@ -2,6 +2,8 @@
use strict;
use warnings;
+
+use base 'Config::Any::Base';
=head1 NAME
@@ -68,16 +70,13 @@
return defined $is_perl_src;
}
-=head2 is_supported( )
+=head2 requires_all_of( )
-Returns true if L<Config::General> is available.
+Specifies that this module requires L<Config::General> in order to work.
=cut
-sub is_supported {
- eval { require Config::General; };
- return $@ ? 0 : 1;
-}
+sub requires_all_of { 'Config::General' }
=head1 AUTHOR
Modified: trunk/libconfig-any-perl/lib/Config/Any/INI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/lib/Config/Any/INI.pm?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/lib/Config/Any/INI.pm (original)
+++ trunk/libconfig-any-perl/lib/Config/Any/INI.pm Sun Nov 16 12:51:26 2008
@@ -2,6 +2,8 @@
use strict;
use warnings;
+
+use base 'Config::Any::Base';
our $MAP_SECTION_SPACE_TO_NESTED_KEY = 1;
@@ -66,16 +68,13 @@
return $out;
}
-=head2 is_supported( )
+=head2 requires_all_of( )
-Returns true if L<Config::Tiny> is available.
+Specifies that this module requires L<Config::Tiny> in order to work.
=cut
-sub is_supported {
- eval { require Config::Tiny; };
- return $@ ? 0 : 1;
-}
+sub requires_all_of { 'Config::Tiny' }
=head1 PACKAGE VARIABLES
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=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/lib/Config/Any/JSON.pm (original)
+++ trunk/libconfig-any-perl/lib/Config/Any/JSON.pm Sun Nov 16 12:51:26 2008
@@ -2,6 +2,8 @@
use strict;
use warnings;
+
+use base 'Config::Any::Base';
=head1 NAME
@@ -58,18 +60,14 @@
}
}
-=head2 is_supported( )
+=head2 requires_any_of( )
-Returns true if either L<JSON::Syck> or L<JSON> is available.
+Specifies that this modules requires one of L<JSON::Syck> or L<JSON> in
+order to work.
=cut
-sub is_supported {
- eval { require JSON::Syck; };
- return 1 unless $@;
- eval { require JSON; };
- return $@ ? 0 : 1;
-}
+sub requires_any_of { 'JSON::Syck', 'JSON' }
=head1 AUTHOR
Modified: trunk/libconfig-any-perl/lib/Config/Any/Perl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/lib/Config/Any/Perl.pm?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/lib/Config/Any/Perl.pm (original)
+++ trunk/libconfig-any-perl/lib/Config/Any/Perl.pm Sun Nov 16 12:51:26 2008
@@ -2,6 +2,8 @@
use strict;
use warnings;
+
+use base 'Config::Any::Base';
my %cache;
@@ -54,16 +56,6 @@
return $content;
}
-=head2 is_supported( )
-
-Returns true.
-
-=cut
-
-sub is_supported {
- return 1;
-}
-
=head1 AUTHOR
Brian Cassidy E<lt>bricas at cpan.orgE<gt>
Modified: trunk/libconfig-any-perl/lib/Config/Any/XML.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/lib/Config/Any/XML.pm?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/lib/Config/Any/XML.pm (original)
+++ trunk/libconfig-any-perl/lib/Config/Any/XML.pm Sun Nov 16 12:51:26 2008
@@ -2,6 +2,8 @@
use strict;
use warnings;
+
+use base 'Config::Any::Base';
=head1 NAME
@@ -73,16 +75,13 @@
$out;
}
-=head2 is_supported( )
+=head2 requires_all_of( )
-Returns true if L<XML::Simple> is available.
+Specifies that this module requires L<XML::Simple> in order to work.
=cut
-sub is_supported {
- eval { require XML::Simple; };
- return $@ ? 0 : 1;
-}
+sub requires_all_of { 'XML::Simple' }
=head1 CAVEATS
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=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/lib/Config/Any/YAML.pm (original)
+++ trunk/libconfig-any-perl/lib/Config/Any/YAML.pm Sun Nov 16 12:51:26 2008
@@ -2,6 +2,8 @@
use strict;
use warnings;
+
+use base 'Config::Any::Base';
=head1 NAME
@@ -54,18 +56,14 @@
}
}
-=head2 is_supported( )
+=head2 requires_any_of( )
-Returns true if either L<YAML::Syck> or L<YAML> is available.
+Specifies that this modules requires one of L<YAML::Syck> (0.70) or L<YAML> in
+order to work.
=cut
-sub is_supported {
- eval { require YAML::Syck; YAML::Syck->VERSION( '0.70' ) };
- return 1 unless $@;
- eval { require YAML; };
- return $@ ? 0 : 1;
-}
+sub requires_any_of { [ 'YAML::Syck', '0.70' ], 'YAML' }
=head1 AUTHOR
Modified: trunk/libconfig-any-perl/t/10-branches.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/t/10-branches.t?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/10-branches.t (original)
+++ trunk/libconfig-any-perl/t/10-branches.t Sun Nov 16 12:51:26 2008
@@ -38,7 +38,8 @@
);
}
-my @files = glob( "t/conf/conf.*" );
+# grep out files we don't understand for these tests
+my @files = grep { !m{\.(foo|unsupported)$} } glob( "t/conf/conf.*" );
my $filter = sub { return };
ok( Config::Any->load_files( { files => \@files, use_ext => 0 } ),
"use_ext 0 works" );
Modified: trunk/libconfig-any-perl/t/50-general.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/t/50-general.t?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/50-general.t (original)
+++ trunk/libconfig-any-perl/t/50-general.t Sun Nov 16 12:51:26 2008
@@ -30,5 +30,5 @@
my $config = eval { Config::Any::General->load( $file ) };
ok( !$config, 'config load failed' );
- ok( $@, "error thrown ($@)" );
+ ok( $@, "error thrown ($@)" );
}
Modified: trunk/libconfig-any-perl/t/51-ini.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/t/51-ini.t?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/51-ini.t (original)
+++ trunk/libconfig-any-perl/t/51-ini.t Sun Nov 16 12:51:26 2008
@@ -53,5 +53,5 @@
my $config = eval { Config::Any::INI->load( $file ) };
ok( !$config, 'config load failed' );
- ok( $@, "error thrown ($@)" );
+ ok( $@, "error thrown ($@)" );
}
Modified: trunk/libconfig-any-perl/t/52-json.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/t/52-json.t?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/52-json.t (original)
+++ trunk/libconfig-any-perl/t/52-json.t Sun Nov 16 12:51:26 2008
@@ -23,5 +23,5 @@
my $config = eval { Config::Any::JSON->load( $file ) };
ok( !$config, 'config load failed' );
- ok( $@, "error thrown ($@)" );
+ ok( $@, "error thrown ($@)" );
}
Modified: trunk/libconfig-any-perl/t/53-perl.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/t/53-perl.t?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/53-perl.t (original)
+++ trunk/libconfig-any-perl/t/53-perl.t Sun Nov 16 12:51:26 2008
@@ -22,5 +22,5 @@
my $config = eval { Config::Any::Perl->load( $file ) };
ok( !$config, 'config load failed' );
- ok( $@, "error thrown ($@)" );
+ ok( $@, "error thrown ($@)" );
}
Modified: trunk/libconfig-any-perl/t/54-xml.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/t/54-xml.t?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/54-xml.t (original)
+++ trunk/libconfig-any-perl/t/54-xml.t Sun Nov 16 12:51:26 2008
@@ -19,13 +19,14 @@
# test invalid config
SKIP: {
- my $broken_libxml = eval { require XML::LibXML; XML::LibXML->VERSION lt '1.59'; };
+ my $broken_libxml
+ = eval { require XML::LibXML; XML::LibXML->VERSION lt '1.59'; };
skip 'XML::LibXML < 1.58 has issues', 2 if $broken_libxml;
- local $SIG{__WARN__} = sub {}; # squash warnings from XML::Simple
+ local $SIG{ __WARN__ } = sub { }; # squash warnings from XML::Simple
my $file = 't/invalid/conf.xml';
my $config = eval { Config::Any::XML->load( $file ) };
ok( !$config, 'config load failed' );
- ok( $@, "error thrown ($@)" );
+ ok( $@, "error thrown ($@)" );
}
Modified: trunk/libconfig-any-perl/t/55-yaml.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/t/55-yaml.t?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/55-yaml.t (original)
+++ trunk/libconfig-any-perl/t/55-yaml.t Sun Nov 16 12:51:26 2008
@@ -23,5 +23,5 @@
my $config = eval { Config::Any::YAML->load( $file ) };
ok( !$config, 'config load failed' );
- ok( $@, "error thrown ($@)" );
+ ok( $@, "error thrown ($@)" );
}
Modified: trunk/libconfig-any-perl/t/61-features.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-any-perl/t/61-features.t?rev=26944&op=diff
==============================================================================
--- trunk/libconfig-any-perl/t/61-features.t (original)
+++ trunk/libconfig-any-perl/t/61-features.t Sun Nov 16 12:51:26 2008
@@ -59,7 +59,7 @@
}
);
- ok( $result, 'load file with parser forced, flatten to hash' );
+ ok( $result, 'load file with parser forced, flatten to hash' );
ok( ref $result, 'load_files hashref contains a ref' );
my $ref = blessed $result ? reftype $result : ref $result;
More information about the Pkg-perl-cvs-commits
mailing list