line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Parse::Path::PerlClass; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.92'; # VERSION |
4
|
|
|
|
|
|
|
# ABSTRACT: Perl::Class::path::support |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
############################################################################# |
7
|
|
|
|
|
|
|
# Modules |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
4429
|
use Moo; |
|
1
|
|
|
|
|
30413
|
|
|
1
|
|
|
|
|
9
|
|
10
|
1
|
|
|
1
|
|
5907
|
use sanity; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
465612
|
use namespace::clean; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
27
|
|
13
|
1
|
|
|
1
|
|
265
|
no warnings 'uninitialized'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
321
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
############################################################################# |
16
|
|
|
|
|
|
|
# Required Methods |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
with 'Parse::Path::Role::Path'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _build_blueprint { { |
21
|
13
|
|
|
13
|
|
2205
|
hash_step_regexp => qr{ |
22
|
|
|
|
|
|
|
(?<key>[a-zA-Z_]\w*) |
23
|
|
|
|
|
|
|
}x, |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
array_step_regexp => qr/\Z.\A/, # no-op; arrays not supported |
26
|
|
|
|
|
|
|
delimiter_regexp => qr{::|'}, |
27
|
|
|
|
|
|
|
delimiter_regexp => qr{(?:\:\:|')(?=[a-zA-Z_])}, # no dangling delimiters |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# no support for escapes |
30
|
|
|
|
|
|
|
unescape_translation => [], |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
pos_translation => [ |
33
|
|
|
|
|
|
|
[qr/.?/, 'X+1'], |
34
|
|
|
|
|
|
|
], |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
delimiter_placement => { |
37
|
|
|
|
|
|
|
HH => '::', |
38
|
|
|
|
|
|
|
}, |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
array_key_sprintf => '', |
41
|
|
|
|
|
|
|
hash_key_stringification => [ |
42
|
|
|
|
|
|
|
[qr/.?/, '%s'], |
43
|
|
|
|
|
|
|
], |
44
|
|
|
|
|
|
|
} } |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
42; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=pod |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=encoding utf-8 |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 NAME |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Parse::Path::PerlClass - Perl::Class::path::support |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 SYNOPSIS |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
use v5.10; |
61
|
|
|
|
|
|
|
use Parse::Path; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
my $path = Parse::Path->new( |
64
|
|
|
|
|
|
|
path => 'Parse::Path', |
65
|
|
|
|
|
|
|
style => 'PerlClass', |
66
|
|
|
|
|
|
|
); |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
say $path->as_string; |
69
|
|
|
|
|
|
|
$path->push($path, 'Role::Path'); |
70
|
|
|
|
|
|
|
say $path->as_string; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 DESCRIPTION |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
This is a path style for Perl classes. Some examples: |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Perl::Class |
77
|
|
|
|
|
|
|
overload::pragma |
78
|
|
|
|
|
|
|
K2P'Foo'Bar'Baz |
79
|
|
|
|
|
|
|
K2P'Class::Fun |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 AVAILABILITY |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
The project homepage is L<https://github.com/SineSwiper/Parse-Path/wiki>. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
The latest version of this module is available from the Comprehensive Perl |
86
|
|
|
|
|
|
|
Archive Network (CPAN). Visit L<http://www.perl.com/CPAN/> to find a CPAN |
87
|
|
|
|
|
|
|
site near you, or see L<https://metacpan.org/module/Parse::Path/>. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 AUTHOR |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Brendan Byrd <bbyrd@cpan.org> |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
This software is Copyright (c) 2013 by Brendan Byrd. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
This is free software, licensed under: |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |