package Dist::Zilla::Plugin::GatherDir::TemplateSkeleton;
our $VERSION = '1.000';
use Moose;
extends 'Dist::Zilla::Plugin::GatherDir::Template';
use autodie;
use Moose::Autobox;
use Dist::Zilla::File::InMemory;
use namespace::autoclean;
around '_file_from_filename' => sub {
my $orig = shift;
my $self = shift;
my ($filename) = @_;
if($filename =~ m{/!}) {
my $content = do {
open my $fh, '<', $filename;
local $/;
<$fh>;
};
my $new_name = $filename;
$new_name =~ s{/!}{/};
return Dist::Zilla::File::InMemory->new({
name => $new_name,
mode => ((stat $filename)[2] & 0755) | 0200,
content => $content,
});
}
return $self->$orig(@_);
};
sub module_name {
my($self) = @_;
(my $main_module_name = $self->zilla->name) =~ s/-/::/g;
return $main_module_name;
}
__PACKAGE__->meta->make_immutable;
no Moose;
1;
=pod
=head1 NAME
=head1 VERSION
=head1 DESCRIPTION
L<Dist::Zilla::Plugin::GatherDir::Template>
=over4
=item *
=item *
C<< {{$plugin->module_name}} >>
=back
=head1 AUTHOR
C<< <grantm@cpan.org> >>
=head1 COPYRIGHT AND LICENSE
=cut