Skip to content

Commit 7d9684d

Browse files
committed
[IO::Path] Track method/attribute name changes
1 parent 9c96bbc commit 7d9684d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/Type/IO/Path.pod

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ unless when stated otherwise.
2828
=head2 method new
2929
3030
multi method new(Str:D $path)
31-
multi method new(:$basename!, :$directory = '.', :$volume = '')
31+
multi method new(:$basename!, :$dirname = '.', :$volume = '')
3232
3333
Creates a new IO::Path object from a path string (which is being parsed for
34-
volume, directory and basename), or from volumen, directory and basename
34+
volume, directory name and basename), or from volume, directory name and basename
3535
passed as named arguments.
3636
3737
=head2 method abspath
@@ -47,14 +47,14 @@ the file relative to to its directory.
4747
4848
say IO::Path.new("/etc/passwd").basename; # passwd
4949
50-
=head2 method directory
50+
=head2 method dirname
5151
52-
method directory(IO::Path:D)
52+
method dirname(IO::Path:D)
5353
54-
Returns the directory portion of the path object. That is, it returns the path
54+
Returns the directory name portion of the path object. That is, it returns the path
5555
excluding the volume and the base name.
5656
57-
say IO::Path.new("/etc/passwd").directory; # /etc
57+
say IO::Path.new("/etc/passwd").dirname; # /etc
5858
5959
=head2 method volume
6060
@@ -69,11 +69,11 @@ the empty string.
6969
7070
method parts(IO::Path:D) returns Hash
7171
72-
Returns a hash with the keys C<directory>, C<path> and C<volume>, and as
72+
Returns a hash with the keys C<dirname>, C<path> and C<volume>, and as
7373
values the return values of the methods with the same names.
7474
7575
say IO::Path.new("/etc/passwd").parts.perl
76-
# ("directory" => "/etc", "volume" => "", "basename" => "passwd").hash
76+
# ("dirname" => "/etc", "volume" => "", "basename" => "passwd").hash
7777
7878
=head2 method path
7979
@@ -126,9 +126,9 @@ Returns a new C<IO::Path> object that is an absolute path, based on C<$base>.
126126
127127
Returns a new C<IO::Path> object relative to the C<$base> path.
128128
129-
=head2 method contents
129+
=head2 method dir
130130
131-
method contents(IO::Path:D: Mu :$test = none('.', '..'))
131+
method dir(IO::Path:D: Mu :$test = none('.', '..'))
132132
133133
Tries to interpret the path as a directory, and returns a lazy list of
134134
C<IO::Path> objects that match the C<$test> smart-matcher.
@@ -143,7 +143,7 @@ An example that lists all files and directories recursively:
143143
sub MAIN($dir = '.') {
144144
my @todo = $dir.path;
145145
while @todo {
146-
for @todo.pop.contents -> $path {
146+
for @todo.pop.dir -> $path {
147147
say $path.Str;
148148
@todo.push: $path if $path.d;
149149
}

0 commit comments

Comments
 (0)