Skip to content

Commit

Permalink
fixed lite_app and plugin generators
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 27, 2011
1 parent 1facccc commit 5756496
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 21 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@
This file documents the revision history for Perl extension Mojolicious.

1.94 2011-08-27 00:00:00
- Fixed lite_app and plugin generators.
- Fixed typos.

1.93 2011-08-27 00:00:00
Expand Down
19 changes: 8 additions & 11 deletions lib/Mojolicious/Command/generate/lite_app.pm
Expand Up @@ -13,9 +13,6 @@ EOF
sub run {
my ($self, $name) = @_;
$name ||= 'myapp.pl';
$self->renderer->line_start('%%');
$self->renderer->tag_start('<%%');
$self->renderer->tag_end('%%>');
$self->render_to_rel_file('liteapp', $name);
$self->chmod_file($name, 0744);
}
Expand All @@ -24,7 +21,7 @@ sub run {
__DATA__
@@ liteapp
%% my $class = shift;
% my $class = shift;
#!/usr/bin/env perl
use Mojolicious::Lite;
Expand All @@ -37,17 +34,17 @@ get '/welcome' => sub {
};
app->start;
<%%%%>__DATA__
<% %>__DATA__
<%%%%>@@ index.html.ep
% layout 'default';
% title 'Welcome';
<% %>@@ index.html.ep
%% layout 'default';
%% title 'Welcome';
Welcome to Mojolicious!
<%%%%>@@ layouts/default.html.ep
<% %>@@ layouts/default.html.ep
<!doctype html><html>
<head><title><%= title %></title></head>
<body><%= content %></body>
<head><title><%%= title %></title></head>
<body><%%= content %></body>
</html>
__END__
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Command/generate/makefile.pm
Expand Up @@ -36,7 +36,7 @@ WriteMakefile(
VERSION_FROM => 'lib/<%= $path %>',
AUTHOR => 'A Good Programmer <nospam@cpan.org>',
EXE_FILES => ['script/<%= $name %>'],
PREREQ_PM => {'Mojolicious' => '1.80'},
PREREQ_PM => {'Mojolicious' => '1.90'},
test => {TESTS => 't/*.t'}
);
Expand Down
18 changes: 9 additions & 9 deletions lib/Mojolicious/Command/generate/plugin.pm
Expand Up @@ -48,40 +48,40 @@ sub register {
}
1;
<%%>__END__
<% %>__END__
<%%>=head1 NAME
<% %>=head1 NAME
<%= $class %> - Mojolicious Plugin
<%%>=head1 SYNOPSIS
<% %>=head1 SYNOPSIS
# Mojolicious
$self->plugin('<%= $name %>');
# Mojolicious::Lite
plugin '<%= $name %>';
<%%>=head1 DESCRIPTION
<% %>=head1 DESCRIPTION
L<<%= $class %>> is a L<Mojolicious> plugin.
<%%>=head1 METHODS
<% %>=head1 METHODS
L<<%= $class %>> inherits all methods from
L<Mojolicious::Plugin> and implements the following new ones.
<%%>=head2 C<register>
<% %>=head2 C<register>
$plugin->register;
Register plugin in L<Mojolicious> application.
<%%>=head1 SEE ALSO
<% %>=head1 SEE ALSO
L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicio.us>.
<%%>=cut
<% %>=cut
@@ test
% my $name = shift;
Expand Down Expand Up @@ -116,7 +116,7 @@ WriteMakefile(
NAME => '<%= $class %>',
VERSION_FROM => 'lib/<%= $path %>',
AUTHOR => 'A Good Programmer <nospam@cpan.org>',
PREREQ_PM => {'Mojolicious' => '1.80'},
PREREQ_PM => {'Mojolicious' => '1.90'},
test => {TESTS => 't/*.t'}
);
Expand Down

0 comments on commit 5756496

Please sign in to comment.