Skip to content

Commit

Permalink
a few more Mojo::Path examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 4, 2013
1 parent 48857a2 commit 792910d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changes
@@ -1,4 +1,7 @@

3.90 2013-03-05
- Improved documentation.

3.89 2013-03-04
- Improved documentation.
- Improved tests.
Expand Down
10 changes: 9 additions & 1 deletion lib/Mojo/Path.pm
Expand Up @@ -187,7 +187,7 @@ Construct a new L<Mojo::Path> object.
Canonicalize path.
# "/foo/baz"
Mojo::Path->new('/foo/bar/../baz')->canonicalize;
Mojo::Path->new('/foo/./bar/../baz')->canonicalize;
=head2 clone
Expand Down Expand Up @@ -248,6 +248,7 @@ Parse path.
Turn path into an absolute string.
# "/i/%E2%99%A5/mojolicious"
Mojo::Path->new('/i/%E2%99%A5/mojolicious')->to_abs_string;
Mojo::Path->new('i/%E2%99%A5/mojolicious')->to_abs_string;
=head2 parts
Expand All @@ -267,6 +268,9 @@ The path parts.
Clone path and remove everything after the right-most slash.
# "/i/%E2%99%A5/"
Mojo::Path->new('/i/%E2%99%A5/mojolicious')->to_dir->to_abs_string;
# "i/%E2%99%A5/"
Mojo::Path->new('i/%E2%99%A5/mojolicious')->to_dir->to_abs_string;
=head2 to_route
Expand All @@ -276,6 +280,7 @@ Clone path and remove everything after the right-most slash.
Turn path into a route.
# "/i/♥/mojolicious"
Mojo::Path->new('/i/%E2%99%A5/mojolicious')->to_route;
Mojo::Path->new('i/%E2%99%A5/mojolicious')->to_route;
=head2 to_string
Expand All @@ -285,6 +290,9 @@ Turn path into a route.
Turn path into a string.
# "/i/%E2%99%A5/mojolicious"
Mojo::Path->new('/i/%E2%99%A5/mojolicious')->to_string;
# "i/%E2%99%A5/mojolicious"
Mojo::Path->new('i/%E2%99%A5/mojolicious')->to_string;
Expand Down

0 comments on commit 792910d

Please sign in to comment.