use strict;
use warnings;
+use base 'Config::Any::Base';
+
=head1 NAME
Config::Any::JSON - Load JSON config files
eval { require JSON::Syck; };
if ( $@ ) {
require JSON;
- return JSON::jsonToObj( $content );
+ eval { JSON->VERSION( 2 ); };
+ return $@ ? JSON::jsonToObj( $content ) : JSON::from_json( $content );
}
else {
return JSON::Syck::Load( $content );
}
}
+=head2 requires_any_of( )
+
+Specifies that this modules requires one of L<JSON::Syck> or L<JSON> in
+order to work.
+
+=cut
+
+sub requires_any_of { 'JSON::Syck', 'JSON' }
+
=head1 AUTHOR
Brian Cassidy E<lt>bricas@cpan.orgE<gt>