Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kentnl/dist-zilla-plugin-prereqs-matchinstalled
Depend on versions of modules the same as you have installed
https://github.com/kentnl/dist-zilla-plugin-prereqs-matchinstalled
dist-zilla perl
Last synced: about 2 months ago
JSON representation
Depend on versions of modules the same as you have installed
- Host: GitHub
- URL: https://github.com/kentnl/dist-zilla-plugin-prereqs-matchinstalled
- Owner: kentnl
- License: other
- Created: 2013-07-31T15:36:03.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-03-03T08:41:52.000Z (almost 8 years ago)
- Last Synced: 2024-06-19T23:10:16.648Z (6 months ago)
- Topics: dist-zilla, perl
- Language: Perl
- Size: 336 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.mkdn
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Dist::Zilla::Plugin::Prereqs::MatchInstalled - Depend on versions of modules the same as you have installed
# VERSION
version 1.001004
# SYNOPSIS
This is based on the code of
[`[Author::KENTNL::Prereqs::Latest::Selective]`](https://metacpan.org/pod/Dist::Zilla::Plugin::Author::KENTNL::Prereqs::Latest::Selective),
but intended for a wider audience.[Prereqs::MatchInstalled]
module = My::ModuleIf you want to automatically add **all** modules that are `prereqs`, perhaps instead look at
[`[Prereqs::MatchInstalled::All]`](https://metacpan.org/pod/Dist::Zilla::Plugin::Prereqs::MatchInstalled::All)**NOTE:** Dependencies will only be upgraded to match the _Installed_ version if they're found elsewhere in the dependency tree.
This is designed so that it integrates with other automated version provisioning.
If you're hard-coding module dependencies instead, you will want to place this module _after_ other modules that declare
dependencies.For instance:
[Prereqs]
Foo = 0[Prereqs::MatchInstalled]
module = Foo^^ `Foo` will be upgraded to the version installed.
By default, dependencies that match values of `module` will be upgraded when they are found in:
phase: build, test, runtime, configure, develop
relation: depends, suggests, recommendsTo change this behavior, specify one or more of the following parameters:
applyto_phase = build
applyto_phase = configureapplyto_relation = requires
etc.
For more complex demands, this also works:
applyto = build.requires
applyto = configure.recommendsAnd that should hopefully be sufficient to cover any conceivable use-case.
Also note, we don't do any sort of sanity checking on the module list you provide.
For instance,
module = strict
module = warningWill both upgrade the strict and warnings dependencies on your module, regardless of how daft an idea that may be.
And with a little glue
module = perl
Does what you want, but you probably shouldn't rely on that :).
# METHODS
## mvp\_multivalue\_args
The following properties can be specified multiple times:
- `applyto`
- `applyto_relation`
- `applyto_phase`
- `modules`## `mvp_aliases`
The `module` is an alias for `modules`
## `current_version_of`
$self->current_version_of($package);
Attempts to find the current version of `$package`.
Returns `undef` if something went wrong.
## `register_prereqs`
This is for [`Dist::Zilla::Role::PrereqSource`](https://metacpan.org/pod/Dist::Zilla::Role::PrereqSource), which gets new prerequisites
from this module.# ATTRIBUTES
## `applyto_phase`
Determines which phases will be checked for module dependencies to upgrade.
[Prereqs::MatchInstalled]
applyto_phase = build
applyto_phase = testDefaults to:
build test runtime configure develop
## `applyto_relation`
Determines which relations will be checked for module dependencies to upgrade.
[Prereqs::MatchInstalled]
applyto_relation = requiresDefaults to:
requires suggests recommends
## `applyto`
Determines the total list of `phase`/`relation` combinations which will be checked for dependencies to upgrade.
If not specified, is built from [`applyto_phase`](#applyto_phase) and [`applyto_relation`](#applyto_relation)
[Prereqs::MatchInstalled]
applyto = runtime.requires
applyto = configure.requires## `modules`
Contains the list of modules that will be searched for in the existing `Prereqs` stash to upgrade.
[Prereqs::MatchInstalled]
module = Foo
module = Bar
modules = Baz ; this is the same as the previous 2If you want to automatically add **all** modules that are `prereqs`, perhaps instead look at
[`[Prereqs::MatchInstalled::All]`](https://metacpan.org/pod/Dist::Zilla::Plugin::Prereqs::MatchInstalled::All)# PRIVATE ATTRIBUTES
## `_applyto_list`
**Internal.**
Contains the contents of [`applyto`](#applyto) represented as an `ArrayRef[ArrayRef[Str]]`
## `_modules_hash`
Contains a copy of [`modules`](#modules) as a hash for easy look-up.
# PRIVATE METHODS
## \_build\_applyto
## \_build\_applyto\_list
## \_build\_\_modules\_hash
## \_user\_wants\_upgrade\_on
# AUTHOR
Kent Fredric
# COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Kent Fredric .
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.