---
name: "Dist::Zilla::Role::MetaProvider::Provider"
section: "3pm"
platform: "linux"
package: "libdist-zilla-plugin-metaprovides-perl"
version: "2.002004-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Dist::Zilla::Role::MetaProvider::Provider"
---

# Dist::Zilla::Role::MetaProvider::Provider(3pm)

A Role for Metadata providers specific to the 'provider' key.

## NAME

Dist::Zilla::Role::MetaProvider::Provider - A Role for Metadata providers specific to the 'provider' key.

## VERSION

version 2.002004

## PUBLIC METHODS

### "metadata"

Fulfills the requirement of Dist::Zilla::Role::MetaProvider by processing results returned from `"$self->provides"`.

## ATTRIBUTES / PARAMETERS

### "inherit\_version"

This dictates how to report versions.

*values*

- •

  Set to "1" **\[default\]** The version defined by Dist::Zilla is the authority, and all versions discovered in packages are ignored.

- •

  Set to "0" The version defined in the discovered class is the authority, and it is copied to the provides metadata.

( To use this feature in a performing class, see "\_resolve\_version" )

### "inherit\_missing"

This dictates how to react when a class is discovered but a version is not specified.

*values*

- •

  Set to "1" **\[default\]** `"dist.ini"`'s version turns up in the final metadata.

- •

  Set to "0". A `"provide"` turns up in the final metadata without a version, which is permissible.

( To use this feature in a performing class, see "\_resolve\_version" )

### "meta\_noindex"

This dictates how to behave when a discovered class is also present in the `"no_index"` META field.

*values*

- •

  Set to "0" **\[default\]**

  `"no_index"` META field will be ignored

- •

  Set to "1"

  `"no_index"` META field will be recognised and things found in it will cause respective packages to not be provided in the metadata.

## PERFORMS ROLES

### MetaProvider

Dist::Zilla::Role::MetaProvider

## REQUIRED METHODS FOR PERFORMING ROLES

### "provides"

Must return an array full of Dist::Zilla::MetaProvides::ProvideRecord instances.

## PRIVATE METHODS

### "\_resolve\_version"

This is a utility method to make performing classes life easier in adhering to user requirements.

```
    my $params  = {
        file => $somefile ,
        $self->_resolve_version( $version );
    }
```

is the suggested use.

Returns either an empty list, or a list with `"('version', $version )"`;

This is so `"{ version => undef }"` does not occur in the YAML.

### "\_try\_regen\_metadata"

This is a nasty hack really, to work around the way `"Dist::Zilla"` handles metaproviders, which result in meta-data being inaccessible to metadata Plugins.

```
  my $meta  = $object->_try_regen_metadata()
```

This at present returns metadata provided by  `"MetaNoIndex"` ( if present ) but will be expanded as needed.

If you have a module you think should be in this list, contact me, or file a bug, I'll do my best ☺

### "\_apply\_meta\_noindex"

This is a utility method to make performing classes life easier in skipping no\_index entries.

```
  my @filtered_provides = $self->_apply_meta_noindex( @provides )
```

is the suggested use.

Returns either an empty list, or a list of `"ProvideRecord"`'s

## SEE ALSO

- •

  Dist::Zilla::Role::MetaProvider

- •

  Dist::Zilla::Plugin::MetaProvider

- •

  Dist::Zilla::MetaProvides::ProvideRecord

## THANKS

- •

  Thanks to David Golden ( xdg / DAGOLDEN ) for the suggestion of the no\_index feature for compatibility with MetaNoIndex plugin.

## AUTHOR

Kent Fredric \<kentnl@cpan.org\>

## COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Kent Fredric \<kentfredric@gmail.com\>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
