Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 16, 2011
1 parent ec0a7d1 commit 2df01f9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 38 deletions.
30 changes: 15 additions & 15 deletions lib/Mojo.pm
Expand Up @@ -25,8 +25,22 @@ has ua => sub {
return $ua;
};

# "Oh, so they have internet on computers now!"
sub new {
my $self = shift->SUPER::new(@_);

# Home
$self->home->detect(ref $self);

# Log directory
$self->log->path($self->home->rel_file('log/mojo.log'))
if -w $self->home->rel_file('log');

return $self;
}

# DEPRECATED in Smiling Cat Face With Heart-Shaped Eyes!
*client = sub {
sub client {
warn <<EOF;
Mojo->client is DEPRECATED in favor of Mojo->us!!!
EOF
Expand All @@ -39,20 +53,6 @@ EOF
$client->log(shift->log);

return $client;
};

# "Oh, so they have internet on computers now!"
sub new {
my $self = shift->SUPER::new(@_);

# Home
$self->home->detect(ref $self);

# Log directory
$self->log->path($self->home->rel_file('log/mojo.log'))
if -w $self->home->rel_file('log');

return $self;
}

sub handler { croak 'Method "handler" not implemented in subclass' }
Expand Down
18 changes: 9 additions & 9 deletions lib/Mojolicious.pm
Expand Up @@ -28,15 +28,6 @@ has sessions => sub { Mojolicious::Sessions->new };
has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

# DEPRECATED in Hot Beverage!
*session = sub {
warn <<EOF;
Mojolicious->session is DEPRECATED in favor of Mojolicious->sessions!!!
But you most likely meant to use Mojolicious::Controller->session anyway.
EOF
shift->sessions(@_);
};

our $CODENAME = 'Smiling Cat Face With Heart-Shaped Eyes';
our $VERSION = '1.14';

Expand Down Expand Up @@ -287,6 +278,15 @@ sub plugin {
# This will run for each request
sub process { shift->dispatch(@_) }

# DEPRECATED in Hot Beverage!
sub session {
warn <<EOF;
Mojolicious->session is DEPRECATED in favor of Mojolicious->sessions!!!
But you most likely meant to use Mojolicious::Controller->session anyway.
EOF
shift->sessions(@_);
}

# Start command system
sub start {
my $class = shift;
Expand Down
18 changes: 9 additions & 9 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -39,15 +39,6 @@ my @RESERVED = (
my $STASH_RE = join '|', @RESERVED;
$STASH_RE = qr/^(?:$STASH_RE)$/;

# DEPRECATED in Smiling Cat Face With Heart-Shaped Eyes!
*client = sub {
warn <<EOF;
Mojolicious::Controller->client is DEPRECATED in favor of
Mojolicious::Controller->ua!!!
EOF
return shift->app->client;
};

# "Is all the work done by the children?
# No, not the whipping."
sub AUTOLOAD {
Expand All @@ -66,6 +57,15 @@ sub AUTOLOAD {

sub DESTROY { }

# DEPRECATED in Smiling Cat Face With Heart-Shaped Eyes!
sub client {
warn <<EOF;
Mojolicious::Controller->client is DEPRECATED in favor of
Mojolicious::Controller->ua!!!
EOF
return shift->app->client;
}

# "For the last time, I don't like lilacs!
# Your first wife was the one who liked lilacs!
# She also liked to shut up!"
Expand Down
10 changes: 5 additions & 5 deletions lib/Test/Mojo.pm
Expand Up @@ -13,16 +13,16 @@ has ua => sub { Mojo::UserAgent->new->ioloop(Mojo::IOLoop->singleton) };
has max_redirects => 0;
has 'tx';

# Silent or loud tests
$ENV{MOJO_LOG_LEVEL} ||= $ENV{HARNESS_IS_VERBOSE} ? 'debug' : 'fatal';

# DEPRECATED in Smiling Cat Face With Heart-Shaped Eyes!
*client = sub {
sub client {
warn <<EOF;
Test::Mojo->client is DEPRECATED in favor of Test::Mojo->ua!!!
EOF
return shift->ua;
};

# Silent or loud tests
$ENV{MOJO_LOG_LEVEL} ||= $ENV{HARNESS_IS_VERBOSE} ? 'debug' : 'fatal';
}

# "Ooh, a graduate student huh?
# How come you guys can go to the moon but can't make my shoes smell good?"
Expand Down

0 comments on commit 2df01f9

Please sign in to comment.