Skip to content

Commit b070999

Browse files
committed
1 parent b99a666 commit b070999

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

doc/Type/IO/Spec/Unix.pod6

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,20 @@ combining character on it:
170170
say IO::Spec::Unix.is-absolute: "/\x[308]foo"; # OUTPUT: «True␤»
171171
say IO::Spec::Unix.is-absolute: "bar"; # OUTPUT: «False␤»
172172
173+
=head2 method path
174+
175+
Defined as:
176+
177+
method path(--> Seq:D)
178+
179+
Splits the value of C«%*ENV<PATH>» on colons (C<":">), replaces empty parts with
180+
C<".">, and returns a L<Seq> with each of the resultant parts. Returns
181+
an empty L<Seq> if C«%*ENV<PATH>» is not set or is an empty string.
182+
183+
%*ENV<PATH> = 'foo:bar/ber::foo:';
184+
IO::Spec::Unix.path.perl.say;
185+
# OUTPUT: «("foo", "bar/ber", ".", "foo", ".").Seq␤»
186+
173187
=head2 method tmpdir
174188
175189
Defined as:

doc/Type/IO/Spec/Win32.pod6

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,20 @@ a volume:
131131
say IO::Spec::Win32.is-absolute: 「C:\foo」; # OUTPUT: «True␤»
132132
say IO::Spec::Win32.is-absolute: "bar"; # OUTPUT: «False␤»
133133
134+
=head2 method path
135+
136+
Defined as:
137+
138+
method path(--> Seq:D)
139+
140+
Splits the value of C«%*ENV<PATH>» (or C«%*ENV<Path>» if the former is not set)
141+
on semicolons (C<";">) and returns a L<Seq> with each of the resultant
142+
parts, always adding element C<"."> to the head. Removes all double
143+
quotes (C<">) it finds.
144+
145+
%*ENV<PATH> = 'foo;"bar"/"ber"';
146+
IO::Spec::Win32.path.perl.say; # OUTPUT: «(".", "foo", "bar/ber").Seq␤»
147+
134148
=head2 method tmpdir
135149
136150
Defined as:

0 commit comments

Comments
 (0)