Skip to content

Commit

Permalink
improved name detection in Mojolicious::Plugin::Config
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 5, 2013
1 parent cca3889 commit 3b7848d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,4 +1,7 @@

3.73 2013-01-06
- Improved name detection in Mojolicious::Plugin::Config.

3.72 2013-01-05
- Deprecated base_tag helper.
- Improved documentation.
Expand Down
1 change: 0 additions & 1 deletion lib/Mojo/Server.pm
Expand Up @@ -18,7 +18,6 @@ sub new {
sub build_app {
my ($self, $app) = @_;
local $ENV{MOJO_EXE};
local $ENV{MOJO_APP} = $app;
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
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -38,7 +38,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Rainbow';
our $VERSION = '3.72';
our $VERSION = '3.73';

sub AUTOLOAD {
my $self = shift;
Expand Down
8 changes: 5 additions & 3 deletions lib/Mojolicious/Plugin/Config.pm
Expand Up @@ -38,9 +38,11 @@ sub register {
my $file = $conf->{file} || $ENV{MOJO_CONFIG};
unless ($file) {

# Class or executable
$file
= $ENV{MOJO_APP} ? decamelize($ENV{MOJO_APP}) : basename($ENV{MOJO_EXE});
# Executable
if ($app->isa('Mojolicious::Lite')) { $file = basename($ENV{MOJO_EXE}) }

# Class
else { $file = decamelize(ref $app) }

# Replace ".pl" and ".t" with default extension
$file =~ s/\.(?:pl|t)$//i;
Expand Down

0 comments on commit 3b7848d

Please sign in to comment.