Subject: | D::Z::R::Plugin::plugin_from_config fails |
Summary: I appear to have tripped over a bug in setting up a plugin via
the global config file, which appears to occur in the
Dist::Zilla::Role::Plugin::plugin_from_config method. As this seems a
fairly central location, I don't at all discount the possibility of
pilot error, in which case I apologize for the bother.
Details:
Given a stanza in config.ini of
[PerlTidy]
perltidyrc = /home/bailey/.perltidyrc
running dzil perltidy yields the user-directed error message (truncated
below)
Your global configuration file couldn't be loaded. It's a file matching
~/.dzil/config.*
but the real problem under the hood appears to be
Can't locate object method "zilla" via package
"Dist::Zilla::MVP::Assembler::GlobalConfig" at (eval
681)[/home/bailey/Workspace/Hacking/Perl/brewed/perls/perl-5.14.1/lib/5.14.1/perl5db.pl:640]
line 2, <GEN0> line 11.
which crops up in Dist::Zilla::Role::Plugin::plugin_from_config at
50: my $self = $class->new(
51: $arg->merge({
52: plugin_name => $name,
53: zilla => $section->sequence->assembler->zilla,
54 }),
55 );
Here $class is "Dist::Zilla::Plugin::PerlTidy", which wants a zilla, but
$section->sequence->assembler is a
Dist::Zilla::MVP::Assembler::GlobalConfig, and neither it nor its
ancestors appears to provide access to the running zilla, since they're
pretty direct extensions of Config::MVP. So I'm not sure how best to
dig up a zilla instance to pass to the plugin.
As a secondary issue, $arg is an unblessed hashref, in this case containing
'perltidyrc' => '/home/bailey/.perltidyrc'
so if the zilla problem is solved, I expect we'll blow up at the
$arg->merge call with the expected
Can't call method "merge" on unblessed reference