CPAN-Meta

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    version.

2.140630  2014-03-04 15:23:40-05:00 America/New_York

  [CHANGED]

  - Default meta-spec URL points to metacpan.org instead of search.cpan.org

  [ADDED]

  - Added a 'load_string' method that guesses whether the string
    is YAML or JSON

2.133380  2013-12-03 23:01:07 America/New_York

  [FIXED]

  - Improved bad version handling during META conversion

  - When downgrading multiple licenses to version 1.x META formats, if all
    the licenses are open source, the downgraded license will be

Changes  view on Meta::CPAN


  [ADDED]

  - CPAN::Meta::Prereqs now has a 'merged_requirements' method for
    combining requirements across multiple phases and types

  [FIXED]

  - Invalid 'meta-spec' is no longer a fatal error: instead, it will
    usually be treated as spec version "1.0" (prior to formalization of the
    meta-spec field).  Conversion has some heuristics for guessing a
    version depending on other fields if 'meta-spec' is missing or invalid.

2.132661  2013-09-23 13:27:46 America/New_York

  [FIXED]

  - updated Makefile.PL logic to support PERL_NO_HIGHLANDER

  [PREREQS]

README  view on Meta::CPAN

      my $meta = CPAN::Meta->load_json_string($json, \%options);

    This method returns a new CPAN::Meta object using the structure
    represented by the given JSON string. In other respects it is identical
    to "load_file()".

  load_string
      my $meta = CPAN::Meta->load_string($string, \%options);

    If you don't know if a string contains YAML or JSON, this method will
    use Parse::CPAN::Meta to guess. In other respects it is identical to
    "load_file()".

  save
      $meta->save($distmeta_file, \%options);

    Serializes the object as JSON and writes it to the given file. The only
    valid option is "version", which defaults to '2'. On Perl 5.8.1 or
    later, the file is saved with UTF-8 encoding.

    For "version" 2 (or higher), the filename should end in '.json'.

history/META-spec-1_2.pod  view on Meta::CPAN

distribution various packages can be found.

When using tools like C<Module::Build> that can generate the
C<provides> mapping for your distribution automatically, make sure you
examine what it generates to make sure it makes sense - indexers will
usually trust the C<provides> field if it's present, rather than
scanning through the distribution files themselves to figure out
packages and versions.  This is a good thing, because it means you can
use the C<provides> field to tell the indexers precisely what you want
indexed about your distribution, rather than relying on them to
essentially guess what you want indexed.

=head2 no_index

Example:

  no_index:
    file:
    - My/Module.pm
    dir:
    - My/Private

history/META-spec-1_3.pod  view on Meta::CPAN

distribution various packages can be found.

When using tools like C<Module::Build> that can generate the
C<provides> mapping for your distribution automatically, make sure you
examine what it generates to make sure it makes sense - indexers will
usually trust the C<provides> field if it's present, rather than
scanning through the distribution files themselves to figure out
packages and versions.  This is a good thing, because it means you can
use the C<provides> field to tell the indexers precisely what you want
indexed about your distribution, rather than relying on them to
essentially guess what you want indexed.

=head2 no_index

Example:

  no_index:
    file:
    - My/Module.pm
    directory:
    - My/Private

history/META-spec-1_4.pod  view on Meta::CPAN

distribution various packages can be found.

When using tools like C<Module::Build> that can generate the
C<provides> mapping for your distribution automatically, make sure you
examine what it generates to make sure it makes sense - indexers will
usually trust the C<provides> field if it's present, rather than
scanning through the distribution files themselves to figure out
packages and versions.  This is a good thing, because it means you can
use the C<provides> field to tell the indexers precisely what you want
indexed about your distribution, rather than relying on them to
essentially guess what you want indexed.

=head2 no_index

Example:

  no_index:
    file:
    - My/Module.pm
    directory:
    - My/Private

lib/CPAN/Meta.pm  view on Meta::CPAN

  };
  croak($@) if $@;
  return $self;
}

#pod =method load_string
#pod
#pod   my $meta = CPAN::Meta->load_string($string, \%options);
#pod
#pod If you don't know if a string contains YAML or JSON, this method will use
#pod L<Parse::CPAN::Meta> to guess.  In other respects it is identical to
#pod C<load_file()>.
#pod
#pod =cut

sub load_string {
  my ($class, $string, $options) = @_;
  $options->{lazy_validation} = 1 unless exists $options->{lazy_validation};

  my $self;
  eval {

lib/CPAN/Meta.pm  view on Meta::CPAN

  my $meta = CPAN::Meta->load_json_string($json, \%options);

This method returns a new CPAN::Meta object using the structure represented by
the given JSON string.  In other respects it is identical to C<load_file()>.

=head2 load_string

  my $meta = CPAN::Meta->load_string($string, \%options);

If you don't know if a string contains YAML or JSON, this method will use
L<Parse::CPAN::Meta> to guess.  In other respects it is identical to
C<load_file()>.

=head2 save

  $meta->save($distmeta_file, \%options);

Serializes the object as JSON and writes it to the given file.  The only valid
option is C<version>, which defaults to '2'. On Perl 5.8.1 or later, the file
is saved with UTF-8 encoding.

lib/CPAN/Meta/History/Meta_1_2.pod  view on Meta::CPAN

distribution various packages can be found.

When using tools like L<Module::Build> that can generate the
C<provides> mapping for your distribution automatically, make sure you
examine what it generates to make sure it makes sense - indexers will
usually trust the C<provides> field if it's present, rather than
scanning through the distribution files themselves to figure out
packages and versions.  This is a good thing, because it means you can
use the C<provides> field to tell the indexers precisely what you want
indexed about your distribution, rather than relying on them to
essentially guess what you want indexed.

=head2 no_index

Example:

  no_index:
    file:
    - My/Module.pm
    dir:
    - My/Private

lib/CPAN/Meta/History/Meta_1_3.pod  view on Meta::CPAN

distribution various packages can be found.

When using tools like L<Module::Build> that can generate the
C<provides> mapping for your distribution automatically, make sure you
examine what it generates to make sure it makes sense - indexers will
usually trust the C<provides> field if it's present, rather than
scanning through the distribution files themselves to figure out
packages and versions.  This is a good thing, because it means you can
use the C<provides> field to tell the indexers precisely what you want
indexed about your distribution, rather than relying on them to
essentially guess what you want indexed.

=head2 no_index

Example:

  no_index:
    file:
    - My/Module.pm
    directory:
    - My/Private

lib/CPAN/Meta/History/Meta_1_4.pod  view on Meta::CPAN

distribution various packages can be found.

When using tools like L<Module::Build> that can generate the
C<provides> mapping for your distribution automatically, make sure you
examine what it generates to make sure it makes sense - indexers will
usually trust the C<provides> field if it's present, rather than
scanning through the distribution files themselves to figure out
packages and versions.  This is a good thing, because it means you can
use the C<provides> field to tell the indexers precisely what you want
indexed about your distribution, rather than relying on them to
essentially guess what you want indexed.

=head2 no_index

Example:

  no_index:
    file:
    - My/Module.pm
    directory:
    - My/Private

lib/Parse/CPAN/Meta.pm  view on Meta::CPAN


This method deserializes the given string of JSON and the result.
If the source was UTF-8 encoded, the string must be decoded before calling
C<load_json_string>.

=head2 load_string

  my $metadata_structure = Parse::CPAN::Meta->load_string($some_string);

If you don't know whether a string contains YAML or JSON data, this method
will use some heuristics and guess.  If it can't tell, it assumes YAML.

=head2 yaml_backend

  my $backend = Parse::CPAN::Meta->yaml_backend;

Returns the module name of the YAML serializer. See L</ENVIRONMENT>
for details.

=head2 json_backend

lib/Parse/CPAN/Meta.pm  view on Meta::CPAN

work for this, to use L<Mojo::JSON> or L<JSON::Tiny> for decoding requires
setting L</CPAN_META_JSON_DECODER>.

=head2 PERL_JSON_BACKEND

If the C<CPAN_META_JSON_BACKEND> environment variable does not exist, and if
C<PERL_JSON_BACKEND> environment variable exists, is true and is not
"JSON::PP", then the L<JSON> module (version 2.5 or greater) will be loaded and
used to interpret C<PERL_JSON_BACKEND>.  If L<JSON> is not installed or is too
old, an exception will be thrown.  Note that at the time of writing, the only
useful values are 1, which will tell L<JSON> to guess, or L<JSON::XS> - if
you want to use a newer JSON module, see L</CPAN_META_JSON_BACKEND>.

=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 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.



( run in 1.283 second using v1.01-cache-2.11-cpan-748bfb374f4 )