Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 2, 2010
1 parent 4a7360a commit 74fe0da
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/Mojo/Asset/File.pm
Expand Up @@ -12,13 +12,12 @@ use base 'Mojo::Asset';
use Carp 'croak';
use File::Copy ();
use File::Spec;
use File::Temp;
use IO::File;
use Mojo::ByteStream 'b';

__PACKAGE__->attr([qw/cleanup path end_range/]);
__PACKAGE__->attr(start_range => 0);
__PACKAGE__->attr(tmpdir => sub { $ENV{MOJO_TMPDIR} || File::Temp::tempdir });
__PACKAGE__->attr(tmpdir => sub { $ENV{MOJO_TMPDIR} || File::Spec->tmpdir });
__PACKAGE__->attr(
handle => sub {
my $self = shift;
Expand Down
5 changes: 2 additions & 3 deletions lib/Mojo/Server/Daemon.pm
Expand Up @@ -10,7 +10,6 @@ use base 'Mojo::Server';
use Carp 'croak';
use Fcntl ':flock';
use File::Spec;
use File::Temp;
use IO::File;
use Mojo::Command;
use Mojo::IOLoop;
Expand All @@ -23,7 +22,7 @@ __PACKAGE__->attr(keep_alive_timeout => 15);
__PACKAGE__->attr(
lock_file => sub {
my $self = shift;
return File::Spec->catfile(File::Spec->splitdir(File::Temp::tempdir),
return File::Spec->catfile($ENV{MOJO_TMPDIR} || File::Spec->tmpdir,
Mojo::Command->class_to_file(ref $self->app) . '.lock');
}
);
Expand All @@ -32,7 +31,7 @@ __PACKAGE__->attr(max_keep_alive_requests => 100);
__PACKAGE__->attr(
pid_file => sub {
my $self = shift;
return File::Spec->catfile(File::Spec->splitdir(File::Temp::tempdir),
return File::Spec->catfile($ENV{MOJO_TMPDIR} || File::Spec->tmpdir,
Mojo::Command->class_to_file(ref $self->app) . '.pid');
}
);
Expand Down
4 changes: 4 additions & 0 deletions t/mojo/app.t
Expand Up @@ -19,9 +19,13 @@ package main;
use strict;
use warnings;

use File::Temp;
use Mojo::IOLoop;
use Test::More;

# Use a clean temporary directory
BEGIN { $ENV{MOJO_TMPDIR} ||= File::Temp::tempdir }

# Make sure sockets are working
plan skip_all => 'working sockets required for this test!'
unless Mojo::IOLoop->new->generate_port;
Expand Down
4 changes: 4 additions & 0 deletions t/mojolicious/app.t
Expand Up @@ -5,9 +5,13 @@
use strict;
use warnings;

use File::Temp;
use Mojo::IOLoop;
use Test::More;

# Use a clean temporary directory
BEGIN { $ENV{MOJO_TMPDIR} ||= File::Temp::tempdir }

# Make sure sockets are working
plan skip_all => 'working sockets required for this test!'
unless Mojo::IOLoop->new->generate_port;
Expand Down
4 changes: 4 additions & 0 deletions t/mojolicious/charset_lite_app.t
Expand Up @@ -7,9 +7,13 @@ use warnings;

use utf8;

use File::Temp;
use Mojo::IOLoop;
use Test::More;

# Use a clean temporary directory
BEGIN { $ENV{MOJO_TMPDIR} ||= File::Temp::tempdir }

# Make sure sockets are working
plan skip_all => 'working sockets required for this test!'
unless Mojo::IOLoop->new->generate_port;
Expand Down
4 changes: 4 additions & 0 deletions t/mojolicious/embedded_lite_app.t
Expand Up @@ -5,9 +5,13 @@
use strict;
use warnings;

use File::Temp;
use Mojo::IOLoop;
use Test::More;

# Use a clean temporary directory
BEGIN { $ENV{MOJO_TMPDIR} ||= File::Temp::tempdir }

# Make sure sockets are working
plan skip_all => 'working sockets required for this test!'
unless Mojo::IOLoop->new->generate_port;
Expand Down
4 changes: 4 additions & 0 deletions t/mojolicious/i18n_lite_app.t
Expand Up @@ -5,9 +5,13 @@
use strict;
use warnings;

use File::Temp;
use Mojo::IOLoop;
use Test::More;

# Use a clean temporary directory
BEGIN { $ENV{MOJO_TMPDIR} ||= File::Temp::tempdir }

# Make sure sockets are working
plan skip_all => 'working sockets required for this test!'
unless Mojo::IOLoop->new->generate_port;
Expand Down
4 changes: 4 additions & 0 deletions t/mojolicious/json_config_lite_app.t
Expand Up @@ -5,9 +5,13 @@
use strict;
use warnings;

use File::Temp;
use Mojo::IOLoop;
use Test::More;

# Use a clean temporary directory
BEGIN { $ENV{MOJO_TMPDIR} ||= File::Temp::tempdir }

# Make sure sockets are working
plan skip_all => 'working sockets required for this test!'
unless Mojo::IOLoop->new->generate_port;
Expand Down
4 changes: 4 additions & 0 deletions t/mojolicious/lite_app.t
Expand Up @@ -7,9 +7,13 @@ use warnings;

use utf8;

use File::Temp;
use Mojo::IOLoop;
use Test::More;

# Use a clean temporary directory
BEGIN { $ENV{MOJO_TMPDIR} ||= File::Temp::tempdir }

# Make sure sockets are working
plan skip_all => 'working sockets required for this test!'
unless Mojo::IOLoop->new->generate_port;
Expand Down
4 changes: 4 additions & 0 deletions t/mojolicious/pod_renderer_lite_app.t
Expand Up @@ -5,9 +5,13 @@
use strict;
use warnings;

use File::Temp;
use Mojo::IOLoop;
use Test::More;

# Use a clean temporary directory
BEGIN { $ENV{MOJO_TMPDIR} ||= File::Temp::tempdir }

# Make sure sockets are working
plan skip_all => 'working sockets required for this test!'
unless Mojo::IOLoop->new->generate_port;
Expand Down
4 changes: 4 additions & 0 deletions t/mojolicious/production_app.t
Expand Up @@ -5,9 +5,13 @@
use strict;
use warnings;

use File::Temp;
use Mojo::IOLoop;
use Test::More;

# Use a clean temporary directory
BEGIN { $ENV{MOJO_TMPDIR} ||= File::Temp::tempdir }

# Make sure sockets are working
plan skip_all => 'working sockets required for this test!'
unless Mojo::IOLoop->new->generate_port;
Expand Down
4 changes: 4 additions & 0 deletions t/mojolicious/websocket_lite_app.t
Expand Up @@ -5,9 +5,13 @@
use strict;
use warnings;

use File::Temp;
use Mojo::IOLoop;
use Test::More;

# Use a clean temporary directory
BEGIN { $ENV{MOJO_TMPDIR} ||= File::Temp::tempdir }

# Make sure sockets are working
plan skip_all => 'working sockets required for this test!'
unless Mojo::IOLoop->new->generate_port;
Expand Down

0 comments on commit 74fe0da

Please sign in to comment.