Skip to content

Commit

Permalink
added a few Mojo::Path examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 23, 2011
1 parent 133d8b3 commit 022f957
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@
This file documents the revision history for Perl extension Mojolicious.

2.10 2011-10-23 00:00:00
- Improved documentation.
- Improved tests.

2.09 2011-10-23 00:00:00
Expand Down
3 changes: 1 addition & 2 deletions lib/Mojo/Message.pm
Expand Up @@ -294,8 +294,7 @@ sub is_dynamic { shift->content->is_dynamic }
sub is_finished { (shift->{state} || '') eq 'finished' }

sub is_limit_exceeded {
my $self = shift;
return unless my $code = ($self->error)[1];
return unless my $code = (shift->error)[1];
return $code ~~ [413, 431];
}

Expand Down
13 changes: 13 additions & 0 deletions lib/Mojo/Path.pm
Expand Up @@ -193,6 +193,9 @@ Construct a new L<Mojo::Path> object.
Canonicalize path.
# "/foo/baz"
say Mojo::Path->new('/foo/bar/../baz')->canonicalize;
=head2 C<clone>
my $clone = $path->clone;
Expand All @@ -206,6 +209,16 @@ Clone path.
Check if path contains given prefix.
Note that this method is EXPERIMENTAL and might change without warning!
# True
Mojo::Path->new('/foo/bar')->contains('/');
Mojo::Path->new('/foo/bar')->contains('/foo');
Mojo::Path->new('/foo/bar')->contains('/foo/bar');
# False
Mojo::Path->new('/foo/bar')->contains('/f');
Mojo::Path->new('/foo/bar')->contains('/bar');
Mojo::Path->new('/foo/bar')->contains('/whatever');
=head2 C<parse>
$path = $path->parse('/foo/bar%3B/baz.html');
Expand Down

0 comments on commit 022f957

Please sign in to comment.