Skip to content

Commit 59cbc38

Browse files
committed
[io grant] Finish off IO::Path.parts
- It now returns a Map, not a Hash - :directory key is no longer there - use Win32 path to showcase :volume - Fix incorrect s/path/basename/ key name Rakudo impl: rakudo/rakudo@9021a48665 rakudo/rakudo@6ed14ef6fc Tests: Raku/roast@fb61306aaa
1 parent f9c3ae7 commit 59cbc38

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

doc/Type/IO/Path.pod6

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,15 @@ the empty string.
281281
282282
Defined as:
283283
284-
method parts(IO::Path:D: --> Hash)
284+
method parts(IO::Path:D: --> Map:D)
285285
286-
Returns a hash with the keys C<dirname>, C<path> and C<volume>, and as
287-
values the return values of the methods with the same names.
286+
Returns a L<Map> with the keys C<volume>, C<dirname>, C<basename> whose values
287+
are the same as available via methods L«C<.volume>|/routine/volume»,
288+
L«C<.dirname>|/routine/dirname», and L«C<.basename>|/routine/basename»
289+
respectively.
288290
289-
say IO::Path.new("/etc/passwd").parts.perl;
290-
# OUTPUT: «{:basename("passwd"), :directory("/etc"), :dirname("/etc"), :volume("")}␤»
291+
say IO::Path::Win32.new("C:/rakudo/perl6.bat").parts.perl;
292+
# OUTPUT: «Map.new((:basename("perl6.bat"),:dirname("/rakudo"),:volume("C:")))␤»
291293
292294
=head method gist
293295

0 commit comments

Comments
 (0)