Added some overview to the docs - would have helped me get my head around it faster#18
Open
timbunce wants to merge 12 commits intoAndyA:masterfrom
Open
Added some overview to the docs - would have helped me get my head around it faster#18timbunce wants to merge 12 commits intoAndyA:masterfrom
timbunce wants to merge 12 commits intoAndyA:masterfrom
Conversation
The add() method can now accept a "modules" (plural) argument that is a hasref containing ModuleName => ModuleVersion pairs. This can be used as an alternative to (but not in conjunction with) the "module" (singular) and version arguments. In practice, any non-trivial distribution is going to contain multiple modules. And those modules could all have different version numbers. But the old "module" (singular) and "version" interface did not support that reality. In fact, mcpi[1] worked around this limitation by calling add() for each module in the distribution. Not only did this seem odd, it causes the tar.gz file to be needlessly copied several times. I would even sugges that the old "module" (singular) and "version" interface sould be deprecated. I added test cases to cover the new interface. Also added test cases to cover the argument validation logic for the add() method. And I updated the POD accordingly.
I decided to just keep the old name for this subroutine, just to minimize churn. Although this sub is only useful for the add() method.
Now I just have to make the code actually behave that way.
You may now specify the version argument with the modules (plural) argument. This serves as the default version of any modules that you did not specify an explicit version number for. This is convenient for module authors (like me) who assign the same version number to all modules in a particular release.
The --module option for mcpi[1] now takes MODULE_NAME=MODULE_VERSION arguments and can be repeated for multiple modules. If you do not specify a MODULE_VERSION for any given MODULE_NAME, then the value of the --version option is used as the default. Here are some examples: # Adds Foo-1.2 and Bar-2.3 mcpi --add --module Foo=1.2 Bar=2.3 --author ME --file Distro.tar.gz # Adds Foo-1.2 and Bar-4.1 mcpi --add --module Foo=1.2 Bar --version 4.1 --author ME --fle Distro.tar.gz # Adds Foo-5.2 and Bar-5.2 mcpi --add --module Foo --module Bar --version 5.2 --author ME --file Distro.tar.gz Notice that this is still perfectly compatible with the old style of using --module and --version to add a single module.
Instead of having separate module (singular) and modules (plural) arguments, the module argument is now polymorphic, and will accept either a stirng (for one module) or a hashref (for multiple modules).
|
@wchristian I'm reviewing the PRs as part of my contribution to the Pull Request Challenge in September 2017. This PR is obsolete, as it has already been included in #12. It seems @timbunce created a PR against Jeffrey's branch, which he consequently merged. We can close this PR and not merge it as it's only relevant to #12. |
|
I've cherry-picked 5b6e80a into briandfoy/cpan-mini-inject@66e65bc, and the rest of the commits from #12 I'll look at later as part of briandfoy/cpan-mini-inject#1. |
|
This is part of 1.002. I can't close this issue though. Thanks, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi Andy. I was tidying up my old git repos and found this one I hadn't sent a pull request for.