Dist-Zilla-Util-SimpleMunge
view release on metacpan or search on metacpan
- Minor documentation bugs with formatting.
1.000000 2014-04-27T11:25:29Z
[00 Major]
- This is a major set of changes, but mostly forwards compatible.
- Only a few minor packaging backcompat risks for downstream $VENDORs who work by HAND.
[01 DZil 5 Encoding Support]
- Dist::Zilla >= 5.0 is now mandatory
- Callback functions now pass an "encoding" value (Â either 'text' or 'bytes'Â )
- This is mostly a pragmatic choice, if it can be decoded, you probably want to work with it decoded
- Otherwise you'll probably want to work with it as bytes.
[02 New Functions]
- A whole bunch of new functions have been added which are more DWIM and trying smarter to advoid the horrible black
magic. - auto_munge_file now the most recommended approach, but supports no laziness overiding.
[03 Less Black Magic]
- There's still a rebless trick or two to cast the refs in-place, but they should be more stable and less prone to
initialization-based errors.
So this module is as simple as I think I can get it without hacking
Dist::Zilla directly.
auto_munge_file $file, sub {
my ( $thefile, $content, $encoding ) = @_;
};
The callback will be called as appropriate.
* $content will contain the content, *decoded if possible*
* $encoding will be either "text" or "bytes", the latter if decoding
is not possible.
* "InMemory" will apply the code immediately
* "FromCode" will take your code and create a chained system so your
code will be evaluated when the file itself is written out.
And this is the most useful and straight forward interface that doesn't
lib/Dist/Zilla/Util/SimpleMunge.pm view on Meta::CPAN
So this module is as simple as I think I can get it without hacking Dist::Zilla directly.
auto_munge_file $file, sub {
my ( $thefile, $content, $encoding ) = @_;
};
The callback will be called as appropriate.
=over 4
=item * C<$content> will contain the content, I<decoded if possible>
=item * C<$encoding> will be either C<text> or C<bytes>, the latter if decoding is not possible.
=item * C<InMemory> will apply the code immediately
=item * C<FromCode> will take your code and create a chained system so your code will be evaluated when the file itself is written out.
=back
And this is the most useful and straight forward interface that doesn't invoke any weird re-blessing magic.
( run in 0.484 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )