cpan/parent/t/parent.t tests for parent.pm
cpan/Parse-CPAN-Meta/Changes
cpan/Parse-CPAN-Meta/lib/Parse/CPAN/Meta.pm
-cpan/Parse-CPAN-Meta/t/01_compile.t
cpan/Parse-CPAN-Meta/t/02_api.t
cpan/Parse-CPAN-Meta/t/03_functions.t
cpan/Parse-CPAN-Meta/t/04_export.t
cpan/Parse-CPAN-Meta/t/05_errors.t
-cpan/Parse-CPAN-Meta/t/data/VR-META.json
-cpan/Parse-CPAN-Meta/t/data/VR-META.yml
+cpan/Parse-CPAN-Meta/t/data/META-VR.json
+cpan/Parse-CPAN-Meta/t/data/META-VR.yml
cpan/Parse-CPAN-Meta/t/lib/Parse/CPAN/Meta/Test.pm
cpan/perlfaq/lib/perlfaq1.pod General Questions About Perl
cpan/perlfaq/lib/perlfaq2.pod Obtaining and Learning about Perl
'Parse::CPAN::Meta' => {
'MAINTAINER' => 'dagolden',
- 'DISTRIBUTION' => 'DAGOLDEN/Parse-CPAN-Meta-1.4404.tar.gz',
+ 'DISTRIBUTION' => 'DAGOLDEN/Parse-CPAN-Meta-1.4405.tar.gz',
'FILES' => q[cpan/Parse-CPAN-Meta],
+ 'EXCLUDED' => [
+ qw(t/00-compile.t),
+ qw[t/00-report-prereqs.t],
+ qr{^xt},
+ ],
'UPSTREAM' => 'cpan',
},
Changes for Perl programming language extension Parse-CPAN-Meta
+1.4405 2013-07-17 21:43:34 America/New_York
+ - Fixed incorrect "return ... or die ..." constructs
+ - Converted distribution to Dist::Zilla management
+ - Noted new repository location in the Github Perl-Toolchain-Gang
+ organization
+
1.4404 Sun Apr 05 2012
- Protected tests from user PERL_YAML/JSON_BACKEND
+use strict;
package Parse::CPAN::Meta;
+# ABSTRACT: Parse META.yml and META.json CPAN metadata files
+our $VERSION = '1.4405'; # VERSION
-use strict;
use Carp 'croak';
# UTF Support?
# Class structure
require 5.004;
require Exporter;
- $Parse::CPAN::Meta::VERSION = '1.4404';
@Parse::CPAN::Meta::ISA = qw{ Exporter };
@Parse::CPAN::Meta::EXPORT_OK = qw{ Load LoadFile };
}
# Create an object from a file
sub LoadFile ($) {
require CPAN::Meta::YAML;
- return CPAN::Meta::YAML::LoadFile(shift)
+ my $object = CPAN::Meta::YAML::LoadFile(shift)
or die CPAN::Meta::YAML->errstr;
+ return $object;
}
# Parse a document from a string.
sub Load ($) {
require CPAN::Meta::YAML;
- return CPAN::Meta::YAML::Load(shift)
+ my $object = CPAN::Meta::YAML::Load(shift)
or die CPAN::Meta::YAML->errstr;
+ return $object;
}
1;
=pod
+=encoding utf-8
+
=head1 NAME
Parse::CPAN::Meta - Parse META.yml and META.json CPAN metadata files
+=head1 VERSION
+
+version 1.4405
+
=head1 SYNOPSIS
#############################################
Note that META files are expected to be in UTF-8 encoding, only. When
converted string data, it must first be decoded from UTF-8.
+=for Pod::Coverage HAVE_UTF8 IO_LAYER
+
=head1 METHODS
=head2 load_file
=head2 PERL_YAML_BACKEND
By default, L<CPAN::Meta::YAML> will be used for deserializing YAML data. If
-the C<PERL_YAML_BACKEND> environment variable is defined, then it is intepreted
+the C<PERL_YAML_BACKEND> environment variable is defined, then it is interpreted
as a module to use for deserialization. The given module must be installed,
must load correctly and must implement the C<Load()> function or an exception
will be thrown.
+=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
+
=head1 SUPPORT
-Bugs should be reported via the CPAN bug tracker at
+=head2 Bugs / Feature Requests
+
+Please report any bugs or feature requests through the issue tracker
+at L<https://rt.cpan.org/Public/Dist/Display.html?Name=Parse-CPAN-Meta>.
+You will be notified automatically of any progress on your issue.
+
+=head2 Source Code
+
+This is open source software. The code repository is available for
+public review and contribution under the terms of the license.
+
+L<http://github.com/Perl-Toolchain-Gang/Parse-CPAN-Meta>
-L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Parse-CPAN-Meta>
+ git clone git://github.com/Perl-Toolchain-Gang/Parse-CPAN-Meta.git
=head1 AUTHOR
-Adam Kennedy E<lt>adamk@cpan.orgE<gt>
+Adam Kennedy <adamk@cpan.org>
+
+=head1 CONTRIBUTORS
+
+=over 4
+
+=item *
+
+David Golden <dagolden@cpan.org>
+
+=item *
+
+Joshua ben Jore <jjore@cpan.org>
+
+=item *
+
+Ricardo SIGNES <rjbs@cpan.org>
+
+=item *
+
+Steffen Müller <smueller@cpan.org>
-=head1 COPYRIGHT
+=back
-Copyright 2006 - 2010 Adam Kennedy.
+=head1 COPYRIGHT AND LICENSE
-This program is free software; you can redistribute
-it and/or modify it under the same terms as Perl itself.
+This software is copyright (c) 2013 by Adam Kennedy and Contributors.
-The full text of the license can be found in the
-LICENSE file included with this module.
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
=cut
+++ /dev/null
-#!/usr/bin/perl
-
-delete $ENV{PERL_YAML_BACKEND};
-delete $ENV{PERL_JSON_BACKEND};
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib/';
- }
-}
-
-use strict;
-BEGIN {
- $| = 1;
- $^W = 1;
-}
-
-use File::Spec::Functions ':ALL';
-use Test::More tests => 3;
-
-# Check their perl version
-ok( $] >= 5.004, "Your perl is new enough" );
-
-# Does the module load
-use_ok( 'Parse::CPAN::Meta' );
-use_ok( 'Parse::CPAN::Meta::Test' );
"version" => "0.101010",
};
-my $meta_json = catfile( test_data_directory(), 'VR-META.json' );
-my $meta_yaml = catfile( test_data_directory(), 'VR-META.yml' );
+my $meta_json = catfile( test_data_directory(), 'META-VR.json' );
+my $meta_yaml = catfile( test_data_directory(), 'META-VR.yml' );
### YAML tests
{
{
local $ENV{PERL_YAML_BACKEND}; # ensure we get CPAN::META::YAML
- my $yaml = load_ok( 'VR-META.yml', $meta_yaml, 100);
+ my $yaml = load_ok( 'META-VR.yml', $meta_yaml, 100);
my $from_yaml = Parse::CPAN::Meta->load_yaml_string( $yaml );
is_deeply($from_yaml, $want, "load from YAML str results in expected data");
}
local $ENV{PERL_YAML_BACKEND} = 'YAML';
is(Parse::CPAN::Meta->yaml_backend(), 'YAML', 'yaml_backend()');
- my $yaml = load_ok( 'VR-META.yml', $meta_yaml, 100);
+ my $yaml = load_ok( 'META-VR.yml', $meta_yaml, 100);
my $from_yaml = Parse::CPAN::Meta->load_yaml_string( $yaml );
is_deeply($from_yaml, $want, "load_yaml_string using PERL_YAML_BACKEND");
}
# JSON tests with JSON::PP
local $ENV{PERL_JSON_BACKEND}; # ensure we get JSON::PP
- my $json = load_ok( 'VR-META.json', $meta_json, 100);
+ my $json = load_ok( 'META-VR.json', $meta_json, 100);
my $from_json = Parse::CPAN::Meta->load_json_string( $json );
is_deeply($from_json, $want, "load from JSON str results in expected data");
}
# JSON tests with JSON::PP, take 2
local $ENV{PERL_JSON_BACKEND} = 0; # request JSON::PP
- my $json = load_ok( 'VR-META.json', $meta_json, 100);
+ my $json = load_ok( 'META-VR.json', $meta_json, 100);
my $from_json = Parse::CPAN::Meta->load_json_string( $json );
is_deeply($from_json, $want, "load_json_string with PERL_JSON_BACKEND = 0");
}
# JSON tests with JSON::PP, take 3
local $ENV{PERL_JSON_BACKEND} = 'JSON::PP'; # request JSON::PP
- my $json = load_ok( 'VR-META.json', $meta_json, 100);
+ my $json = load_ok( 'META-VR.json', $meta_json, 100);
my $from_json = Parse::CPAN::Meta->load_json_string( $json );
is_deeply($from_json, $want, "load_json_string with PERL_JSON_BACKEND = 'JSON::PP'");
}
local $ENV{PERL_JSON_BACKEND} = 1;
is(Parse::CPAN::Meta->json_backend(), 'JSON', 'json_backend()');
- my $json = load_ok( 'VR-META.json', $meta_json, 100);
+ my $json = load_ok( 'META-VR.json', $meta_json, 100);
my $from_json = Parse::CPAN::Meta->load_json_string( $json );
is_deeply($from_json, $want, "load_json_string with PERL_JSON_BACKEND = 1");
}