Skip to content

Commit

Permalink
small optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 6, 2013
1 parent 7b6ef50 commit 6d6f87e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion lib/Mojo/Server.pm
Expand Up @@ -17,7 +17,6 @@ sub new {

sub build_app {
my ($self, $app) = @_;
local $ENV{MOJO_EXE};
return $app->new unless my $e = Mojo::Loader->new->load($app);
die ref $e ? $e : qq{Couldn't find application class "$app".\n};
}
Expand Down
5 changes: 2 additions & 3 deletions lib/Mojolicious/Lite.pm
Expand Up @@ -8,20 +8,19 @@ use Mojo::UserAgent;
use Mojo::Util 'monkey_patch';

sub import {
my $class = shift;

# Executable
$ENV{MOJO_EXE} ||= (caller)[1];

# Home
local $ENV{MOJO_HOME} = catdir(split '/', dirname($ENV{MOJO_EXE}))
local $ENV{MOJO_HOME} = catdir(split '/', dirname $ENV{MOJO_EXE})
unless $ENV{MOJO_HOME};

# Initialize app
my $caller = caller;
no strict 'refs';
push @{"${caller}::ISA"}, 'Mojo';
my $app = $class->new;
my $app = shift->new;

# Initialize routes
my $routes = $app->routes->namespaces([]);
Expand Down

0 comments on commit 6d6f87e

Please sign in to comment.