Skip to content

be more literal in the synopses#150

Open
karenetheridge wants to merge 1 commit intomasterfrom
ether/synopsis-load-meta
Open

be more literal in the synopses#150
karenetheridge wants to merge 1 commit intomasterfrom
ether/synopsis-load-meta

Conversation

@karenetheridge
Copy link
Member

closes #141


my $struct = decode_json_file('META.json');

my $struct = Parse::CPAN::Meta->load_file('META.json');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using this statement, I get reasonable results running the convert-metadata.pl program I presented in #141.

$ cat convert-metadata.pl
#!/usr/bin/env perl
use 5.14.0;
use warnings;
use Carp;
use Data::Dump qw(dd pp);
use Parse::CPAN::Meta;
use CPAN::Meta::Converter;

my $jsonfile = './META.json';
croak "Unable to locate $jsonfile" unless -f $jsonfile;

#my $struct = decode_json_file($jsonfile);
my $struct = Parse::CPAN::Meta->load_file('META.json');

my $cmc = CPAN::Meta::Converter->new($struct);

my $new_struct = $cmc->convert( version => "2" );
dd $new_struct;

$ perl ./convert-metadata.pl 
{
  "abstract"                => "Compare elements of two or more lists",
  "author"                  => ["James E Keenan (jkeenan\@cpan.org)"],
  "dynamic_config"          => 1,
  "generated_by"            => "ExtUtils::MakeMaker version 7.70, CPAN::Meta::Converter version 2.150010",
  "license"                 => ["perl_5"],
  "meta-spec"               => {
                                 url => "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
                                 version => 2,
                               },
  "name"                    => "List-Compare",
  "no_index"                => { directory => ["t", "inc"] },
  "prereqs"                 => {
                                 build => { requires => { "ExtUtils::MakeMaker" => 0 } },
                                 configure => { requires => { "ExtUtils::MakeMaker" => 0 } },
                                 test => { requires => { "Capture::Tiny" => 0, "Test::Simple" => 0.1 } },
                               },
  "release_status"          => "stable",
  "resources"               => {
                                 bugtracker => {
                                                 mailto => "bug-list-compare\@rt.cpan.org",
                                                 web => "https://rt.cpan.org/Public/Dist/Display.html?Name=List-Compare",
                                               },
                                 homepage   => "http://thenceforward.net/perl/modules/List-Compare/",
                                 repository => {
                                                 type => "git",
                                                 url  => "https://github.com/jkeenan/list-compare.git",
                                                 web  => "https://github.com/jkeenan/list-compare",
                                               },
                               },
  "version"                 => 0.55,
  "x_serialization_backend" => "JSON::PP version 4.16",
}

my $struct = decode_json_file('META.json');

my $struct = Parse::CPAN::Meta->load_file('META.json');
my $cmv = CPAN::Meta::Validator->new( $struct );
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not had a reason to use CPAN::Meta::Validator, but this looks like reasonable guidance to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CPAN::Meta::Converter: SYNOPSIS displays non-existent functions

2 participants