Possibly fixed test
[p5sagit/Oyster.git] / .build / spEUsgyear / lib / Dist / Zilla / Plugin / Oyster / New.pm
CommitLineData
e74d6d9c 1use strict;
2use warnings;
3package Dist::Zilla::Plugin::Oyster::New;
4BEGIN {
5 our $VERSION = 0.01;# VERSION
6}
7use Moose;
8use Dist::Zilla::Plugin::Oyster::Helper;
9with qw( Dist::Zilla::Role::ModuleMaker );
10
11use Dist::Zilla::File::FromCode;
12
13sub make_module {
14 my ( $self ) = @_;
15
16 if ( $Catalyst::Helper::VERSION <= 1.28 ) {
17 $self->log('getting authors from ENV variable AUTHOR not dzil');
18 }
19
20 # format $name to what C::Helper wants
21 my $name = $self->zilla->name;
22 $name =~ s/-/::/g;
23
24 # turn authors into a scalar it's what C::Helper wants
25 my $authors = join( ',', @{$self->zilla->authors} );
26
27 my $helper
28 = Dist::Zilla::Plugin::Oyster::Helper->new({
29 name => $name,
30 author => $authors,
31 _zilla_gatherer => $self,
32 });
33
34 # $name here is for backcompat in older versions of C::Devel
35 $helper->mk_app( $name );
36}
37__PACKAGE__->meta->make_immutable;
38no Moose;
391;
40# ABSTRACT: create a new catalyst project with dzil new
41
42
43__END__
44=pod
45
46=head1 NAME
47
48Dist::Zilla::Plugin::Oyster::New - create a new Oyster project with dzil new
49
50=head1 VERSION
51
52version 0.07
53
54=head1 SYNOPSIS
55
56in C<{home}/.dzil/profiles/oyster/profile.ini>
57
58 [Oyster::New / :DefaultModuleMaker]
59 [@Oyster]
60
61=head1 DESCRIPTION
62
63this plugin is used to generate the same files L<Catalyst::Helper> does when
64C<catalyst.pl App::Name> is run.
65
66=head1 EXAMPLE
67
68You probably want more than just the bare minimum profile.ini, here's a more
69functional one. I suggest putting it in
70C<{home}/.dzil/profiles/oyster/profile.ini>
71
72 [Oyster::New / :DefaultModuleMaker]
73 [@Oyster]
74
75Now you can run the following command to create a skeleton catalyst app.
76
77 dzil new -p oyster MyApp
78
79Obviously C<MyApp> is arbitrary and can be named whatever you like.
80
81=head1 METHODS
82
83=over
84
85=item * make_module
86
87required see L<Dist::Zilla::Role::ModuleMaker>
88
89=back
90
91=head1 BUGS
92
93or features depending on your opinion and the nature of the issue. The
94following are known "issue's".
95
96=over
97
98=item * Doesn't create all the files catalyst.pl does
99
100Some files like README, Makefile.PL and some of the tests, etc, are better
101generated by C<dzil>. Use existing dzil plugins to generate these.
102
103=back
104
105For all other problems use the bug tracker
106
107=head1 AUTHORS
108
109=over 4
110
111=item *
112
113TODO, see CONTRIBUTORS
114
115=back
116
117=head1 COPYRIGHT AND LICENSE
118
119This software is Copyright (c) 2010 by Caleb Cushing.
120
121This is free software, licensed under:
122
123 The Artistic License 2.0
124
125=cut
126