Fixing bugs
[p5sagit/Oyster.git] / .build / spEUsgyear / lib / Dist / Zilla / Plugin / Oyster / Helper.pm
CommitLineData
e74d6d9c 1use strict;
2use warnings;
3package Dist::Zilla::Plugin::Oyster::Helper;
4BEGIN {
5 our $VERSION = 0.01;# VERSION
6}
7use Moose;
8use Dist::Zilla::File::InMemory;
9
10extends 'Catalyst::Helper';
11
12has _zilla_gatherer => (
13 is => 'ro',
14 required => 1,
15 handles => {
16 _zilla_add_file => 'add_file',
17 },
18);
19
20# we don't want these to do anything
21sub _mk_changes {};
22sub _mk_makefile {};
23sub _mk_readme {};
24sub _mk_apptest {};
25sub _mk_podtest {};
26sub _mk_podcoveragetest {};
27
28sub mk_file {
29 my ( $self, $file_obj , $output ) = @_;
30
31 # unfortunately the stringified $file_obj includes a prepended
32 # {dist_repo} name which dzil already creates if we don't regex it out we
33 # end up with {dist_repo}/{dist_repo}/{files} instead of just
34 # {dist_repo}/{files}
35 my $name = "$file_obj";
36 $name =~ s{[\w-]+/}{};
37
38 my $file
39 = Dist::Zilla::File::InMemory->new({
40 name => $name,
41 content => $output,
42 });
43
44 $file->mode( oct(755) ) if $file->name =~ /script/;
45
46 $self->_zilla_add_file($file);
47}
48__PACKAGE__->meta->make_immutable;
49no Moose;
501;
51# ABSTRACT: a subclass of Catalyst::Helper
52
53
54__END__
55=pod
56
57=head1 NAME
58
59Dist::Zilla::Plugin::Oyster::Helper - a subclass of Catalyst::Helper
60
61=head1 VERSION
62
63version 0.07
64
65=head1 DESCRIPTION
66
67this is used to override methods in L<Catalyst::Helper> so that it works
68better with dzil.
69
70=head1 AUTHORS
71
72=over 4
73
74=item *
75
76CONTRIBUTORS TODO (note, based on xenoterracide & t0m's work)
77
78=back
79
80=head1 COPYRIGHT AND LICENSE
81
82TODO
83
84This is free software, licensed under:
85
86 The Artistic License 2.0
87
88=cut
89