Skip to content

Commit

Permalink
minified makefile command
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 17, 2012
1 parent 119ec72 commit c389c6d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Changes
Expand Up @@ -11,7 +11,7 @@ This file documents the revision history for Perl extension Mojolicious.
Mojo::Message.
- Improved resilience of Mojo::IOLoop::Client.
- Improved documentation.
- Fixed small bug in makefile command.
- Fixed small bugs in makefile command. (tempire, marcus, sri)

2.49 2012-02-13 00:00:00
- Deprecated Mojolicious::Renderer->root in favor of
Expand Down
19 changes: 4 additions & 15 deletions lib/Mojolicious/Command/generate/makefile.pm
Expand Up @@ -7,32 +7,21 @@ has usage => "usage: $0 generate makefile\n";
# "If we don't go back there and make that event happen,
# the entire universe will be destroyed...
# And as an environmentalist, I'm against that."
sub run {
my $self = shift;
my $class = $ENV{MOJO_APP};
$class = 'MyApp' if !$class || ref $class;
my $path = $self->class_to_path($class);
my $name = $self->class_to_file($class);
$self->render_to_rel_file('makefile', 'Makefile.PL', $class, $path, $name);
}
sub run { shift->render_to_rel_file('makefile', 'Makefile.PL') }

1;
__DATA__
@@ makefile
% my ($class, $path, $name) = @_;
use strict;
use warnings;
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => '<%= $class %>',
VERSION_FROM => 'lib/<%= $path %>',
AUTHOR => 'A Good Programmer <nospam@cpan.org>',
EXE_FILES => ['script/<%= $name %>'],
PREREQ_PM => {'Mojolicious' => '2.0'},
test => {TESTS => 't/*.t'}
VERSION => '0.01',
PREREQ_PM => {'Mojolicious' => '2.50'},
test => {TESTS => 't/*.t'}
);
__END__
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Command/generate/plugin.pm
Expand Up @@ -108,7 +108,7 @@ WriteMakefile(
NAME => '<%= $class %>',
VERSION_FROM => 'lib/<%= $path %>',
AUTHOR => 'A Good Programmer <nospam@cpan.org>',
PREREQ_PM => {'Mojolicious' => '2.0'},
PREREQ_PM => {'Mojolicious' => '2.50'},
test => {TESTS => 't/*.t'}
);
Expand Down

0 comments on commit c389c6d

Please sign in to comment.