Skip to content

Commit

Permalink
the argument did not serve a purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 14, 2015
1 parent fe192a0 commit 5f39e3d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/Mojolicious/Commands.pm
Expand Up @@ -13,7 +13,6 @@ has message => sub { shift->extract_usage . "\nCommands:\n" };
has namespaces => sub { ['Mojolicious::Command'] };

sub detect {
my ($self, $guess) = @_;

# PSGI (Plack only for now)
return 'psgi' if defined $ENV{PLACK_ENV};
Expand All @@ -22,7 +21,7 @@ sub detect {
return 'cgi' if defined $ENV{PATH_INFO} || defined $ENV{GATEWAY_INTERFACE};

# Nothing
return $guess;
return undef;
}

# Command line options for MOJO_HELP, MOJO_HOME and MOJO_MODE
Expand All @@ -47,7 +46,7 @@ sub run {
return $self->app if defined $ENV{MOJO_APP_LOADER};

# Try to detect environment
$name = $self->detect($name) unless $ENV{MOJO_NO_DETECT};
if (!$ENV{MOJO_NO_DETECT} && (my $env = $self->detect)) { $name = $env }

# Run command
if ($name && $name =~ /^\w+$/ && ($name ne 'help' || $args[0])) {
Expand Down Expand Up @@ -299,7 +298,6 @@ implements the following new ones.
=head2 detect
my $env = $commands->detect;
my $env = $commands->detect($guess);
Try to detect environment.
Expand Down

0 comments on commit 5f39e3d

Please sign in to comment.