package Mirror::JSON;
use 5.006;
use strict;
use Mirror::URI ();
use JSON ();
use vars qw{$VERSION @ISA};
BEGIN {
$VERSION = '0.90';
@ISA = 'Mirror::URI';
}
#######################
'mirror.json';
}
sub parse {
my $class = shift;
# Make sure we actually have a YAML document
unless ( $_[0] =~ /^{/ ) {
return undef;
}
# Parse the file
my $docs = JSON::from_json($_[0]);
Carp::croak("Illegal JSON document");
}
return $docs;
}
1;
=pod
=head1 NAME
Mirror::JSON - Mirror Configuration and Auto-Discovery
=head1 DESCRIPTION
A C<mirror.json> file is used to allow
5.006;
use strict;
use Mirror::JSON;
use vars qw{$VERSION @ISA};
BEGIN {
$VERSION = '0.90';
@ISA = 'Mirror::JSON';
}
sub filename {
return 'modules/07mirror.json';
}
1;
# Copyright 2007 - 2
act the author.
=head1 AUTHOR
Adam Kennedy E<lt>adamk@cpan.orgE<gt>
=head1 SEE ALSO
L<Mirror::JSON>, L<Mirror::CPAN>, L<YAML::Tiny>
=head1 COPYRIGHT
Copyright 2007 - 2009 Adam Kennedy.
This pro
RI> is an abstract base class for the mirror
auto-discovery modules L<Mirror::YAML> and L<Mirror::JSON>.
See their documentation for more details.
=head1 SUPPORT
Bugs should be reported via the CPA
=head1 AUTHOR
Adam Kennedy E<lt>adamk@cpan.orgE<gt>
=head1 SEE ALSO
L<Mirror::YAML>, L<Mirror::JSON>, L<Mirror::CPAN>
=head1 COPYRIGHT
Copyright 2007 - 2009 Adam Kennedy.
This program is free so