Skip to content

Commit

Permalink
improved class detection of inflate command
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 23, 2011
1 parent 13a5cd1 commit d0d713f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -3,6 +3,7 @@ This file documents the revision history for Perl extension Mojolicious.
2.40 2011-12-24 00:00:00
- Added EXPERIMENTAL JSON Pointer support. (crab)
- Improved inactivity timeouts by allowing them to be disabled.
- Improved class detection of inflate command.
- Improved documentation.
- Fixed repository to not favor specific editors.

Expand Down
10 changes: 1 addition & 9 deletions lib/Mojolicious/Command/inflate.pm
Expand Up @@ -2,7 +2,6 @@ package Mojolicious::Command::inflate;
use Mojo::Base 'Mojo::Command';

use Getopt::Long 'GetOptions';
use Mojo::Loader;
use Mojo::Util 'encode';

has description => <<'EOF';
Expand All @@ -12,7 +11,6 @@ has usage => <<"EOF";
usage: $0 inflate [OPTIONS]
These options are available:
--class <class> Class to inflate.
--public <path> Path prefix for generated static files, defaults to
"public".
--templates <path> Path prefix for generated template files, defaults to
Expand All @@ -25,21 +23,15 @@ sub run {

# Options
local @ARGV = @_;
my $class = 'main';
my $public = 'public';
my $templates = 'templates';
GetOptions(
'class=s' => sub { $class = $_[1] },
'public=s' => sub { $public = $_[1] },
'templates=s' => sub { $templates = $_[1] },
);

# Load class
my $e = Mojo::Loader->load($class);
die $e if ref $e;

# Generate
my $all = $self->get_all_data($class);
my $all = $self->get_all_data($self->app->renderer->default_template_class);
for my $file (keys %$all) {
my $prefix = $file =~ /\.\w+\.\w+$/ ? $templates : $public;
my $path = $self->rel_file("$prefix/$file");
Expand Down
1 change: 0 additions & 1 deletion lib/Mojolicious/Plugin/EPRenderer.pm
@@ -1,7 +1,6 @@
package Mojolicious::Plugin::EPRenderer;
use Mojo::Base 'Mojolicious::Plugin';

use Mojo::Loader;
use Mojo::Template;
use Mojo::Util qw/encode md5_sum/;

Expand Down

0 comments on commit d0d713f

Please sign in to comment.