rjbs / config-mvp Goto Github PK
View Code? Open in Web Editor NEWmultivalue property config section state machine
multivalue property config section state machine
Config::MVP is where the real issue in rjbs/Dist-Zilla#581 eminates from once you peel off the stack trace hiding.
I wanted to create a new FinderCode
plugin from within my bundle with the following config:
[
'FinderCode', 'MyPersonalFinder',
{
code => \&_my_sub,
style => 'list',
} ,
],
Unfortunately, a dzil build
breaks with the following error message
Not an ARRAY reference at ~/perl5/lib/perl5/Config/MVP/Assembler/WithBundles.pm line 149, <GEN0> line 29.
The problem seems to be that Config::MVP::Assembler::WithBundles
, version 2.200010, treats every ref as an array.
my @v = ref $payload->{$name}
? @{$payload->{$name}}
: $payload->{$name};
Shouldn't this be
my @v = ref $payload->{$name} eq ref []
? @{$payload->{$name}}
: $payload->{$name};
Localizing @INC
(3966df4) breaks this Dist::Zilla
use case:
[lib]
lib = inc
[PodWeaver]
config_plugin = @MyBundle ; uh oh
since munging happens after read_config
.
# dzil build
...
Pod::Weaver::PluginBundle::MyBundle (for section @MyBundle) does not appear to be installed
...
Right now Dist::Zilla has custom code for parsing dist.ini for "; authordep" declarations. It would be really nice if the ini parser itself could recognize these, which would let us jump up and down and yell when prereqs are not satisfied. At the moment, there is no checking of these directives, which lets a build process continue on until (possibly) a cryptic error occurs later on. Better for us to detect this early and either warn or die as soon as we know there is an issue!
(perhaps this belongs in the Config::INI queue? I don't know!)
It is probably possible to convert all this code to Moo now, for potential speed. Maybe someone would be interested in trying!
as discussed tonight on #distzilla
I added a new mvp_multivalue_arg option in a Dist::Zilla plugin. When using it in dist.ini I do:
[PluginName]
:version = 0.002
option = foo
option = bar
However, when doing a build when the new version of the plugin is not installed, I get:
multiple values given for property -include_sub in section PluginName at /Users/ether/.perlbrew/libs/21.6@std/lib/perl5/Config/MVP/Assembler.pm line 208.
This is as not a clear an error as we'd get if the version was checked first: Dist::Zilla::Plugin::PluginName version (0.001) does not match required version: 0.002
Is it possible to check the version first before reading PluginName->mvp_multivalue_args
?
http://advent.rjbs.manxome.org/2009/2009-12-20.html would be useful to reference in the docs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.