GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Here's the pull request I promised.
The logic for discovering modules was in the bin/mcpani script
which meant it couldn't be used from things like CPAN::Mini::Inject::Server.
This patch uses Dist::Metadata (which uses CPAN::Meta and Module::Metadata) to discover provided packages inside CPAN::Mini::Inject::add() and removes the no-longer needed functionality from the script.
I think I added sufficient tests to go with the changes.
What do you think?
p.s. I did not do anything like update $CPAN::Mini::Inject::VERSION.
Obviously that's for you to do since you're the maintainer/releaser.
Besides I don't know how to build with Module::Build. I only use it for installing. I'm a Dist::Zilla guy. :-)
Fix find-modules regexp to ignore t/ and inc/
Include root directory of tar when anchoring the regexp.
Skip the main module when auto-discovering packages
rather than duplicate it.
Warn if provides hash is empty
simple boolean check would never evaluate to true
use Dist::Metadata to determine as much info as possible
dist name and version
and multiple packages
Test adding a dist with multiple modules
and requiring less data up front.
Add example tar.gz for new test
Remove metadata discovery that is now in lib/
Define 'added_modules' to enable post-add inspection
Document it, test it, and use it from bin/mcpani.
Document that packages are discovered in add() Pod
Fix a couple of typos
Remove now unused module discovery methods from bin/mcpani
Leave old options in as no-op's.
Describe the method of determining package/versions
Link to Dist::Metadata so people know where to look
if they want to know why/how it works.
Make reused variable name more generic
Reformat croak line to be more consistent with others
Be less specific about the internals of Dist::Metadata
in case it changes.
That's what the link is for.
Gzip tar file that was supposed to be gzipped
Don't set module/version args to dist name/version
Instead of guessing a module/version by mangling dist name,
just use the discovered packages.
If none are discoverable, croak that module/version are required.
Don't overwrite discovered version with specified one
to avoid confusion/incorrect indexing.
Include tar.gz file used in tests
Add Dist::Metadata to the preqreqs in Build.PL
Remove modules that are no longer used directly
Archive::Tar and Module::Build::ModuleInfo
are no longer used by code in this distribution.
Just sounding off here, because right now my internet sucks so much that doing anything online is a pain. After the 18th i'll be able to poke at this more closely. Also, interestingly thaljef seems to have done something related: AndyA#12
Merged this in because the tests are all still working, with additional ones and everything looks sane. Plus, he went and poked me on IRC. :D