Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Dist-Zilla-Plugin-CoalescePod CPAN distribution.

Report information
The Basics
Id: 86844
Status: resolved
Priority: 0/
Queue: Dist-Zilla-Plugin-CoalescePod

People
Owner: Nobody in particular
Requestors: michael.jemmeson [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Inserting POD before __DATA__
Firstly, thanks for the plugin, very useful. However, it doesn't work with a __DATA__ section - would you consider a patch to insert the POD prior to any __DATA__ block? I'm not yet aware of any modules to parse pm files, so had just been splitting on __DATA__, I don't know if you know of a better way? thanks, Michael
Subject: Re: [rt.cpan.org #86844] Inserting POD before __DATA__
Date: Sat, 13 Jul 2013 13:45:40 -0400
To: bug-Dist-Zilla-Plugin-CoalescePod [...] rt.cpan.org
From: Yanick Champoux <yanick [...] babyl.dyndns.org>
On 13-07-11 04:26 AM, M Jemmeson via RT wrote: Show quoted text
> Firstly, thanks for the plugin, very useful.
Music to my ears. :-) Show quoted text
> However, it doesn't work with a __DATA__ section - would you consider a patch to insert the POD prior to any __DATA__ block? > > I'm not yet aware of any modules to parse pm files, so had just been > splitting on __DATA__, I don't know if you know of a better way?
Oh, yes, true. Fortunately, I think it's going to be very easy to solve. As you pointed out, I think the fix is as simple as doing: sub munge_file { my ( $self, $file ) = @_; return unless $file->name =~ /\.pm$/; ( my $podname = $file->name ) =~ s/\.pm$/.pod/; my ( $podfile ) = grep { $_->name eq $podname } @{ $self->zilla->files } or return; my @content = split /(^__DATA__$)/m, $file->content; # inject the pod splice @content, 1, 0, $podfile->content; $file->content( join '', @content ); $self->zilla->prune_file($podfile); } I'll patch the module and make sure it doesn't break anything. Expect a new release coming out real soon. :-) Thanks! `/anick
Fixed in 0.2.0. Enjoy!
On Sat Jul 13 14:56:00 2013, YANICK wrote: Show quoted text
> Fixed in 0.2.0. Enjoy!
Thanks, that's pretty much what I'd done, except your regex is a bit smarter (I'd forgotten about capture in split). thanks again, Michael
Subject: Re: [rt.cpan.org #86844] Inserting POD before __DATA__
Date: Mon, 15 Jul 2013 20:56:31 -0400
To: bug-Dist-Zilla-Plugin-CoalescePod [...] rt.cpan.org
From: Yanick Champoux <yanick [...] babyl.dyndns.org>
On 13-07-15 04:59 AM, M Jemmeson via RT wrote: Show quoted text
> Thanks, that's pretty much what I'd done, except your regex is a bit smarter (I'd forgotten about capture in split).
Yup, capturing in the split can be useful sometimes. :-) Enjoy the patch! `/anick