From: Brian Cassidy Date: Tue, 21 Jul 2009 01:25:38 +0000 (+0000) Subject: add YAML::XS to the top of the YAML loaders. tidy up some copyright lines. X-Git-Tag: v0.18~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=commitdiff_plain;h=c793253e5f2ad3ca9d60e96e07a5d87fa344ec31 add YAML::XS to the top of the YAML loaders. tidy up some copyright lines. --- diff --git a/Changes b/Changes index 3718d31..49e7fc8 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Config-Any +0.18 XXX + - add YAML::XS to the top of the YAML loaders list + 0.17 Thu 05 Feb 2009 - ensure require() happens against plugin specified in force_plugins. - add JSON::XS to the top of the JSON loaders list diff --git a/lib/Config/Any.pm b/lib/Config/Any.pm index 8699b55..d9c660c 100644 --- a/lib/Config/Any.pm +++ b/lib/Config/Any.pm @@ -6,7 +6,7 @@ use warnings; use Carp; use Module::Pluggable::Object (); -our $VERSION = '0.17'; +our $VERSION = '0.18'; =head1 NAME diff --git a/lib/Config/Any/Base.pm b/lib/Config/Any/Base.pm index 84ad932..65fe15f 100644 --- a/lib/Config/Any/Base.pm +++ b/lib/Config/Any/Base.pm @@ -67,7 +67,7 @@ Brian Cassidy Ebricas@cpan.orgE =head1 COPYRIGHT AND LICENSE -Copyright 2008 by Brian Cassidy +Copyright 2008-2009 by Brian Cassidy This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/lib/Config/Any/General.pm b/lib/Config/Any/General.pm index 749b3c4..bb70c50 100644 --- a/lib/Config/Any/General.pm +++ b/lib/Config/Any/General.pm @@ -88,7 +88,7 @@ Joel Bernstein C<< >> =head1 COPYRIGHT AND LICENSE -Copyright 2007 by Brian Cassidy +Copyright 2006-2009 by Brian Cassidy Portions Copyright 2006 Portugal Telecom diff --git a/lib/Config/Any/INI.pm b/lib/Config/Any/INI.pm index 132f079..a43ac53 100644 --- a/lib/Config/Any/INI.pm +++ b/lib/Config/Any/INI.pm @@ -103,7 +103,7 @@ Joel Bernstein Erataxis@cpan.orgE =head1 COPYRIGHT AND LICENSE -Copyright 2007 by Brian Cassidy, portions copyright 2006, 2007 by Joel Bernstein +Copyright 2006-2009 by Brian Cassidy, portions copyright 2006, 2007 by Joel Bernstein This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/lib/Config/Any/JSON.pm b/lib/Config/Any/JSON.pm index b283b86..ce29549 100644 --- a/lib/Config/Any/JSON.pm +++ b/lib/Config/Any/JSON.pm @@ -79,7 +79,7 @@ Brian Cassidy Ebricas@cpan.orgE =head1 COPYRIGHT AND LICENSE -Copyright 2007 by Brian Cassidy +Copyright 2006-2009 by Brian Cassidy This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/lib/Config/Any/Perl.pm b/lib/Config/Any/Perl.pm index 2798d87..fee9e4d 100644 --- a/lib/Config/Any/Perl.pm +++ b/lib/Config/Any/Perl.pm @@ -62,7 +62,7 @@ Brian Cassidy Ebricas@cpan.orgE =head1 COPYRIGHT AND LICENSE -Copyright 2007 by Brian Cassidy +Copyright 2006-2009 by Brian Cassidy This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/lib/Config/Any/XML.pm b/lib/Config/Any/XML.pm index ed48589..46060c4 100644 --- a/lib/Config/Any/XML.pm +++ b/lib/Config/Any/XML.pm @@ -102,7 +102,7 @@ Joel Bernstein Erataxis@cpan.orgE =head1 COPYRIGHT AND LICENSE -Copyright 2007 by Brian Cassidy +Copyright 2006-2009 by Brian Cassidy This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/lib/Config/Any/YAML.pm b/lib/Config/Any/YAML.pm index c2f852d..c852ef4 100644 --- a/lib/Config/Any/YAML.pm +++ b/lib/Config/Any/YAML.pm @@ -43,6 +43,11 @@ sub load { my $class = shift; my $file = shift; + eval { require YAML::XS }; + unless ( $@ ) { + return YAML::XS::LoadFile( $file ); + } + eval { require YAML::Syck; YAML::Syck->VERSION( '0.70' ) }; unless ( $@ ) { open( my $fh, $file ) or die $!; @@ -62,7 +67,7 @@ order to work. =cut -sub requires_any_of { [ 'YAML::Syck', '0.70' ], 'YAML' } +sub requires_any_of { 'YAML::XS', [ 'YAML::Syck', '0.70' ], 'YAML' } =head1 AUTHOR @@ -70,7 +75,7 @@ Brian Cassidy Ebricas@cpan.orgE =head1 COPYRIGHT AND LICENSE -Copyright 2007 by Brian Cassidy +Copyright 2006-2009 by Brian Cassidy This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.