Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
treat all aliases the same
  • Loading branch information
kraih committed Aug 1, 2012
1 parent 5aa9eb4 commit 4c78bdd
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 23 deletions.
14 changes: 7 additions & 7 deletions lib/Mojo/Message.pm
Expand Up @@ -78,7 +78,7 @@ sub body_params {
return $p;
}

sub body_size { shift->content->body_size }
sub body_size { shift->content->body_size(@_) }

# "My new movie is me, standing in front of a brick wall for 90 minutes.
# It cost 80 million dollars to make.
Expand Down Expand Up @@ -176,19 +176,19 @@ sub get_start_line_chunk {
$offset, 131072;
}

sub has_leftovers { shift->content->has_leftovers }
sub has_leftovers { shift->content->has_leftovers(@_) }

sub header_size { shift->fix_headers->content->header_size }

sub headers { shift->content->headers }
sub is_chunked { shift->content->is_chunked }
sub is_dynamic { shift->content->is_dynamic }
sub headers { shift->content->headers(@_) }
sub is_chunked { shift->content->is_chunked(@_) }
sub is_dynamic { shift->content->is_dynamic(@_) }

sub is_finished { shift->{state} ~~ 'finished' }

sub is_limit_exceeded { (shift->error)[1] ~~ [413, 431] }

sub is_multipart { shift->content->is_multipart }
sub is_multipart { shift->content->is_multipart(@_) }

sub json {
my ($self, $pointer) = @_;
Expand All @@ -203,7 +203,7 @@ sub json_class {
return @_ > 1 ? shift : 'Mojo::JSON';
}

sub leftovers { shift->content->leftovers }
sub leftovers { shift->content->leftovers(@_) }

sub param { shift->body_params->param(@_) }

Expand Down
19 changes: 9 additions & 10 deletions lib/Mojo/Transaction/WebSocket.pm
Expand Up @@ -106,7 +106,7 @@ sub client_handshake {
sub client_read { shift->server_read(@_) }
sub client_write { shift->server_write(@_) }

sub connection { shift->handshake->connection }
sub connection { shift->handshake->connection(@_) }

sub finish {
my $self = shift;
Expand All @@ -117,9 +117,9 @@ sub finish {

sub is_websocket {1}

sub kept_alive { shift->handshake->kept_alive }
sub local_address { shift->handshake->local_address }
sub local_port { shift->handshake->local_port }
sub kept_alive { shift->handshake->kept_alive(@_) }
sub local_address { shift->handshake->local_address(@_) }
sub local_port { shift->handshake->local_port(@_) }

sub parse_frame {
my ($self, $buffer) = @_;
Expand Down Expand Up @@ -183,10 +183,10 @@ sub parse_frame {
return [$fin, $rsv1, $rsv2, $rsv3, $op, $payload];
}

sub remote_address { shift->handshake->remote_address }
sub remote_port { shift->handshake->remote_port }
sub req { shift->handshake->req }
sub res { shift->handshake->res }
sub remote_address { shift->handshake->remote_address(@_) }
sub remote_port { shift->handshake->remote_port(@_) }
sub req { shift->handshake->req(@_) }
sub res { shift->handshake->res(@_) }

sub resume {
my $self = shift;
Expand Down Expand Up @@ -547,8 +547,7 @@ Alias for C<$ws-E<gt>handshake-E<gt>res>, usually L<Mojo::Transaction/"res">.
$ws = $ws->resume;
Alias for C<$ws-E<gt>handshake-E<gt>resume>, usually
L<Mojo::Transaction/"resume">.
Resume C<handshake> transaction.
=head2 C<send>
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Upload.pm
Expand Up @@ -14,8 +14,8 @@ has headers => sub { Mojo::Headers->new };
# This game makes no sense.
# Tell that to the good men who just lost their lives... SEMPER-FI!"
sub move_to { shift->asset->move_to(@_) }
sub size { shift->asset->size }
sub slurp { shift->asset->slurp }
sub size { shift->asset->size(@_) }
sub slurp { shift->asset->slurp(@_) }

1;

Expand Down
6 changes: 3 additions & 3 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -328,8 +328,8 @@ sub rendered {
}

# "A three month calendar? What is this, Mercury?"
sub req { shift->tx->req }
sub res { shift->tx->res }
sub req { shift->tx->req(@_) }
sub res { shift->tx->res(@_) }

sub respond_to {
my $self = shift;
Expand Down Expand Up @@ -446,7 +446,7 @@ sub stash {
return $self;
}

sub ua { shift->app->ua }
sub ua { shift->app->ua(@_) }

sub url_for {
my $self = shift;
Expand Down
2 changes: 1 addition & 1 deletion t/mojolicious/dispatcher_lite_app.t
Expand Up @@ -77,7 +77,7 @@ app->routes->add_condition(
res => sub {
my ($r, $c) = @_;
return 1 unless $c->param('res');
$c->tx->res(
$c->res(
Mojo::Message::Response->new(code => 201)->body('Conditional response!')
);
$c->rendered and return;
Expand Down

0 comments on commit 4c78bdd

Please sign in to comment.