Subject: | Config::Any::YAML should delegate to YAML::Any |
Hi there,
Config::Any::YAML should delegate loading YAML files to YAML::Any - and
the message about what's deprecated. Spamming uncontrollable error
messages causes test failures where are none:
http://www.cpantesters.org/cpan/report/b1f56942-9d15-11df-9cd8-308f90befd91
Reasonable patch attached.
Jens
Subject: | Config-Any-YAML-Any.patch |
Index: lib/Config/Any/YAML.pm
===================================================================
--- lib/Config/Any/YAML.pm (revision 13458)
+++ lib/Config/Any/YAML.pm (working copy)
@@ -41,39 +41,27 @@
=cut
+my $yaml_loaded;
+
sub load {
my $class = shift;
my $file = shift;
- eval { require YAML::XS };
- unless ( $@ ) {
- return YAML::XS::LoadFile( $file );
+ eval { require YAML::Any; $yaml_loaded = YAML::Any->VERSION(); } unless $yaml_loaded;
+ if ( $yaml_loaded ) {
+ return YAML::Any::LoadFile( $file );
}
- Carp::carp
- 'Use of YAML::Syck or YAML to parse config files is DEPRECATED. '
- . 'Please install YAML::XS for proper YAML support';
-
- eval { require YAML::Syck; YAML::Syck->VERSION( '0.70' ) };
- unless ( $@ ) {
- open( my $fh, $file ) or die $!;
- my $content = do { local $/; <$fh> };
- close $fh;
- return YAML::Syck::Load( $content );
- }
-
- require YAML;
- return YAML::LoadFile( $file );
+ return;
}
=head2 requires_any_of( )
-Specifies that this modules requires one of L<YAML::XS>, L<YAML::Syck> (0.70) or
-L<YAML> in order to work.
+Specifies that this modules requires YAML::Any 0.60 to work.
=cut
-sub requires_any_of { 'YAML::XS', [ 'YAML::Syck', '0.70' ], 'YAML' }
+sub requires_any_of { [ 'YAML::Any', '0.67' ], }
=head1 AUTHOR
@@ -94,6 +82,8 @@
=item * L<Config::Any>
+=item * L<YAML::Any>
+
=item * L<YAML::XS>
=item * L<YAML>