Skip Menu |

This queue is for tickets about the Config-Any CPAN distribution.

Report information
The Basics
Id: 59973
Status: open
Priority: 0/
Queue: Config-Any

People
Owner: bricas [...] cpan.org
Requestors: REHSACK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



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>
Hahaha, I was about to write the same suggestion when I found this patch. My only qualm with is it potentially adds another dependency. YAML.pm is a big pile of shit with 77 open bugs. YAML::Any knows this -- and internally YAML.pm is fourth on the order list of YAML backends. my @implementations = qw( YAML::XS YAML::Syck YAML::Old YAML YAML::Tiny ); This raises the question why it is bundled together or if it is fit yet to be used like JSON::Any. My answer would be no. Until JSON::Any is packaged independently it is rather silly to use it. I think what needs to happen is JSON::Any, and YAML::Any probably need to give way to something new.. Maybe a super-module like CPAN_Shittness::Any, or something that can unify the ::Any-s I'm thinking about patching JSON::Any right now because it doesn't support module-pass through of arguments (which adds abstraction at the cost of a silly presumption that I don't agree with). -- Evan Carroll System Lord of the Internets http://www.evancarroll.com
Thanks for your report + patch. I will be discussion our best course of action with respect to YAML parsing with other devs. I hope to resolve this soon.