Skip to content

Commit

Permalink
improved exception handling of all scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 7, 2012
1 parent a36c162 commit 77f1557
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 42 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -3,6 +3,7 @@ This file documents the revision history for Perl extension Mojolicious.
2.94 2012-05-07
- Added support for 308 redirects to Mojo::UserAgent.
- Added support for new HTTP status codes.
- Improved exception handling of all scripts.
- Improved built-in web servers to log inactivity timeouts as debug messages
instead of errors.
- Improved documentation.
Expand Down
8 changes: 1 addition & 7 deletions lib/Mojolicious/Command/generate/app.pm
Expand Up @@ -61,14 +61,8 @@ my @base = (splitdir(dirname(__FILE__)), '..');
my $lib = join('/', @base, 'lib');
-e catdir(@base, 't') ? unshift(@INC, $lib) : push(@INC, $lib);
# Check if Mojolicious is installed;
die <<EOF unless eval 'use Mojolicious::Commands; 1';
It looks like you don't have the Mojolicious framework installed.
Please visit http://mojolicio.us for detailed installation instructions.
EOF
# Start commands for application
require Mojolicious::Commands;
Mojolicious::Commands->start_app('<%= $class %>');
@@ appclass
Expand Down
8 changes: 1 addition & 7 deletions lib/Mojolicious/Guides/Growing.pod
Expand Up @@ -660,14 +660,8 @@ environments.
my $lib = join('/', @base, 'lib');
-e catdir(@base, 't') ? unshift(@INC, $lib) : push(@INC, $lib);

# Check if Mojolicious is installed
die <<EOF unless eval 'use Mojolicious::Commands; 1';
It looks like you don't have the Mojolicious framework installed.
Please visit http://mojolicio.us for detailed installation instructions.

EOF

# Start commands for application
require Mojolicious::Commands;
Mojolicious::Commands->start_app('MyApp');

=head2 Simplified tests
Expand Down
8 changes: 1 addition & 7 deletions script/hypnotoad
Expand Up @@ -12,13 +12,6 @@ my @base = (splitdir(dirname(__FILE__)), '..');
my $lib = join('/', @base, 'lib');
-e catdir(@base, 't') ? unshift(@INC, $lib) : push(@INC, $lib);

# Check if Mojolicious is installed
die <<EOF unless eval 'use Mojo::Server::Hypnotoad; 1';
It looks like you don't have the Mojolicious framework installed.
Please visit http://mojolicio.us for detailed installation instructions.
EOF

# "Hey sexy mama, wanna kill all humans?"
my $help;
GetOptions(
Expand Down Expand Up @@ -46,6 +39,7 @@ EOF

# "This is it.
# The moment we should've trained for."
require Mojo::Server::Hypnotoad;
Mojo::Server::Hypnotoad->new->run($app);

=head1 NAME
Expand Down
8 changes: 1 addition & 7 deletions script/mojo
Expand Up @@ -11,14 +11,8 @@ my @base = (splitdir(dirname(__FILE__)), '..');
my $lib = join('/', @base, 'lib');
-e catdir(@base, 't') ? unshift(@INC, $lib) : push(@INC, $lib);

# Check if Mojolicious is installed
die <<EOF unless eval 'use Mojolicious::Commands; 1';
It looks like you don't have the Mojolicious framework installed.
Please visit http://mojolicio.us for detailed installation instructions.
EOF

# "My eyes! The goggles do nothing!"
require Mojolicious::Commands;
Mojolicious::Commands->start;

=head1 NAME
Expand Down
8 changes: 1 addition & 7 deletions script/morbo
Expand Up @@ -12,13 +12,6 @@ my @base = (splitdir(dirname(__FILE__)), '..');
my $lib = join('/', @base, 'lib');
-e catdir(@base, 't') ? unshift(@INC, $lib) : push(@INC, $lib);

# Check if Mojolicious is installed
die <<EOF unless eval 'use Mojo::Server::Morbo; 1';
It looks like you don't have the Mojolicious framework installed.
Please visit http://mojolicio.us for detailed installation instructions.
EOF

# "Welcome to 'Entertainment And Earth Invasion Tonite'.
# Across the galaxy my people are completing the mighty space fleet that
# will exterminate the human race!
Expand Down Expand Up @@ -58,6 +51,7 @@ EOF
# global warming.
# Morbo is pleased but sticky."
$ENV{MOJO_LISTEN} = join(',', @listen) if @listen;
require Mojo::Server::Morbo;
my $morbo = Mojo::Server::Morbo->new;
$morbo->watch(\@watch) if @watch;
$morbo->run($app);
Expand Down
8 changes: 1 addition & 7 deletions t/mojolicious/external/script/my_app
Expand Up @@ -17,12 +17,6 @@ my @base = (splitdir(dirname(__FILE__)), '..');
my $lib = join('/', @base, 'lib');
-e catdir(@base, 't') ? unshift(@INC, $lib) : push(@INC, $lib);

# Check if Mojolicious is installed
die <<EOF unless eval 'use Mojolicious::Commands; 1';
It looks like you don't have the Mojolicious framework installed.
Please visit http://mojolicio.us for detailed installation instructions.
EOF

# Start commands for application
require Mojolicious::Commands;
Mojolicious::Commands->start_app('MyApp');

0 comments on commit 77f1557

Please sign in to comment.