Skip to content

Commit

Permalink
improved Mojo::Server to use FindBin more defensively (closes #518)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 29, 2013
1 parent 019b22f commit 52990dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,5 +1,6 @@

4.22 2013-07-30
- Improved Mojo::Server to use FindBin more defensively.

4.21 2013-07-29
- Added strip method to Mojo::DOM.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Server.pm
Expand Up @@ -2,7 +2,6 @@ package Mojo::Server;
use Mojo::Base 'Mojo::EventEmitter';

use Carp 'croak';
use FindBin;
use Mojo::Loader;
use Mojo::Util 'md5_sum';
use Scalar::Util 'blessed';
Expand All @@ -27,9 +26,10 @@ sub build_tx { shift->app->build_tx }
sub load_app {
my ($self, $path) = @_;

# Clean environment (reset FindBin)
# Clean environment (reset FindBin defensively)
{
local $0 = $path;
require FindBin;
FindBin->again;
local $ENV{MOJO_APP_LOADER} = 1;
local $ENV{MOJO_EXE};
Expand Down

0 comments on commit 52990dc

Please sign in to comment.