Commit | Line | Data |
4aedd3bb |
1 | use strict; |
2 | use warnings; |
3 | package Dist::Zilla::Plugin::Oyster::New; |
4 | BEGIN { |
5 | our $VERSION = 0.01;# VERSION |
6 | } |
7 | use Moose; |
8 | use Dist::Zilla::Plugin::Oyster::Helper; |
9 | with qw( Dist::Zilla::Role::ModuleMaker ); |
10 | |
11 | use Dist::Zilla::File::FromCode; |
12 | |
13 | sub 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; |
38 | no Moose; |
39 | 1; |
40 | # ABSTRACT: create a new catalyst project with dzil new |
41 | |
42 | |
43 | __END__ |
44 | =pod |
45 | |
46 | =head1 NAME |
47 | |
48 | Dist::Zilla::Plugin::Oyster::New - create a new Oyster project with dzil new |
49 | |
50 | =head1 VERSION |
51 | |
52 | version 0.07 |
53 | |
54 | =head1 SYNOPSIS |
55 | |
56 | in C<{home}/.dzil/profiles/oyster/profile.ini> |
57 | |
58 | [Oyster::New / :DefaultModuleMaker] |
59 | [@Oyster] |
60 | |
61 | =head1 DESCRIPTION |
62 | |
63 | this plugin is used to generate the same files L<Catalyst::Helper> does when |
64 | C<catalyst.pl App::Name> is run. |
65 | |
66 | =head1 EXAMPLE |
67 | |
68 | You probably want more than just the bare minimum profile.ini, here's a more |
69 | functional one. I suggest putting it in |
70 | C<{home}/.dzil/profiles/oyster/profile.ini> |
71 | |
72 | [Oyster::New / :DefaultModuleMaker] |
73 | [@Oyster] |
74 | |
75 | Now you can run the following command to create a skeleton catalyst app. |
76 | |
77 | dzil new -p oyster MyApp |
78 | |
79 | Obviously C<MyApp> is arbitrary and can be named whatever you like. |
80 | |
81 | =head1 METHODS |
82 | |
83 | =over |
84 | |
85 | =item * make_module |
86 | |
87 | required see L<Dist::Zilla::Role::ModuleMaker> |
88 | |
89 | =back |
90 | |
91 | =head1 BUGS |
92 | |
93 | or features depending on your opinion and the nature of the issue. The |
94 | following are known "issue's". |
95 | |
96 | =over |
97 | |
98 | =item * Doesn't create all the files catalyst.pl does |
99 | |
100 | Some files like README, Makefile.PL and some of the tests, etc, are better |
101 | generated by C<dzil>. Use existing dzil plugins to generate these. |
102 | |
103 | =back |
104 | |
105 | For all other problems use the bug tracker |
106 | |
107 | =head1 AUTHORS |
108 | |
109 | =over 4 |
110 | |
111 | =item * |
112 | |
113 | TODO, see CONTRIBUTORS |
114 | |
115 | =back |
116 | |
117 | =head1 COPYRIGHT AND LICENSE |
118 | |
119 | This software is Copyright (c) 2010 by Caleb Cushing. |
120 | |
121 | This is free software, licensed under: |
122 | |
123 | The Artistic License 2.0 |
124 | |
125 | =cut |
126 | |