Skip to content

Commit

Permalink
style tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
gray committed Nov 3, 2010
1 parent 652853c commit 627e781
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/MojoX/Renderer/Xslate.pm
Expand Up @@ -4,8 +4,8 @@ use strict;
use warnings;
use parent qw(Mojo::Base);

use Mojo::Command ();
use File::Spec ();
use Mojo::Command;
use Text::Xslate ();
use Try::Tiny;

Expand All @@ -22,23 +22,21 @@ sub build {

sub _init {
my ($self, %args) = @_;

my $app = $args{mojo} || $args{app};
my $cache_dir;
my @path;
if($app) {
my @path = $app->home->rel_dir('templates');

if ($app) {
$cache_dir = $app->home->rel_dir('tmp/compiled_templates');
@path = (
Mojo::Command->new->get_all_data(
$app->renderer->default_template_class,
),
push @path, Mojo::Command->new->get_all_data(
$app->renderer->default_template_class,
);
}
else {
$cache_dir = File::Spec->tmpdir;
}

unshift @path, $app->home->rel_dir('templates'),

my %config = (
cache_dir => $cache_dir,
path => \@path,
Expand Down

0 comments on commit 627e781

Please sign in to comment.