Skip to content

Commit

Permalink
small Hypnotoad documentation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 25, 2012
1 parent 6eeff54 commit 4104439
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
3 changes: 2 additions & 1 deletion lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -580,7 +580,8 @@ the server has been stopped.
proxy => 1
Activate reverse proxy support.
Activate reverse proxy support, defaults to the value of the
C<MOJO_REVERSE_PROXY> environment variable.
=head2 C<upgrade_timeout>
Expand Down
37 changes: 18 additions & 19 deletions lib/Mojo/URL.pm
Expand Up @@ -125,29 +125,28 @@ sub parse {
sub path {
my ($self, $path) = @_;

# Old path
return $self->{path} ||= Mojo::Path->new unless $path;

# New path
if ($path) {
if (!ref $path) {

# Absolute path
if ($path =~ m#^/#) { $path = Mojo::Path->new($path) }

# Relative path
else {
my $new = Mojo::Path->new($path);
$path = $self->{path} || Mojo::Path->new;
pop @{$path->parts} unless $path->trailing_slash;
push @{$path->parts}, @{$new->parts};
$path->leading_slash(1);
$path->trailing_slash($new->trailing_slash);
}
if (!ref $path) {

# Absolute path
if ($path =~ m#^/#) { $path = Mojo::Path->new($path) }

# Relative path
else {
my $new = Mojo::Path->new($path);
$path = $self->{path} || Mojo::Path->new;
pop @{$path->parts} unless $path->trailing_slash;
push @{$path->parts}, @{$new->parts};
$path->leading_slash(1);
$path->trailing_slash($new->trailing_slash);
}
$self->{path} = $path;

return $self;
}
$self->{path} = $path;

return $self->{path} ||= Mojo::Path->new;
return $self;
}

sub query {
Expand Down

0 comments on commit 4104439

Please sign in to comment.