line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
1665
|
use Map::Metro::Standard::Moops; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
11
|
|
2
|
1
|
|
|
1
|
|
2020
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
74
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.2300'; # VERSION |
6
|
|
|
|
|
|
|
# PODNAME: Map::Metro::Shim |
7
|
|
|
|
|
|
|
# ABSTRACT: Easily load a map file |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
1660
|
class Map::Metro::Shim { |
|
1
|
|
|
1
|
|
35
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
69
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
290
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
64
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
56
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
102
|
|
|
1
|
|
|
|
|
38
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
4613
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
6688
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
4402
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
78
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
231
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
1362
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
6169
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
54
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
156
|
|
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
5230
|
|
|
1
|
|
|
|
|
21
|
|
|
1
|
|
|
|
|
190
|
|
|
0
|
|
|
|
|
0
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
15345
|
use Map::Metro::Graph; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
117
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
|
|
17
|
has filepath => ( |
14
|
|
|
|
|
|
|
is => 'rw', |
15
|
|
|
|
|
|
|
isa => AbsFile, |
16
|
|
|
|
|
|
|
required => 1, |
17
|
|
|
|
|
|
|
coerce => 1, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
has hooks => ( |
20
|
|
|
|
|
|
|
is => 'ro', |
21
|
|
|
|
|
|
|
isa => ArrayRef, |
22
|
|
|
|
|
|
|
traits => ['Array'], |
23
|
1
|
|
|
|
|
31
|
default => sub { [] }, |
24
|
1
|
|
|
|
|
6380
|
handles => { |
25
|
|
|
|
|
|
|
all_hooks => 'elements', |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
1
|
50
|
|
1
|
|
2914
|
around BUILDARGS($orig: $class, @args) { |
|
1
|
50
|
|
1
|
|
2
|
|
|
1
|
50
|
|
|
|
477
|
|
|
1
|
50
|
|
|
|
7488
|
|
|
1
|
|
|
|
|
24
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
2
|
|
30
|
1
|
50
|
|
|
|
4
|
return $class->$orig(@args) if scalar @args == 2; |
31
|
1
|
50
|
|
|
|
10
|
return $class->$orig(filepath => shift @args) if scalar @args == 1; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
0
|
my %args; |
34
|
0
|
0
|
|
|
|
0
|
if(scalar @args % 2 != 0) { |
35
|
0
|
|
|
|
|
0
|
my $filepath = shift @args; |
36
|
0
|
|
|
|
|
0
|
%args = @args; |
37
|
0
|
|
|
|
|
0
|
$args{'filepath'} = $filepath; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
else { |
40
|
0
|
|
|
|
|
0
|
%args = @args; |
41
|
|
|
|
|
|
|
} |
42
|
0
|
0
|
0
|
|
|
0
|
if(exists $args{'hooks'} && !ArrayRef->check($args{'hooks'})) { |
43
|
0
|
|
|
|
|
0
|
$args{'hooks'} = [$args{'hooks'}]; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
0
|
return $class->$orig(%args); |
47
|
|
|
|
|
|
|
}; |
48
|
|
|
|
|
|
|
|
49
|
1
|
50
|
33
|
1
|
|
2264
|
method parse(:$override_line_change_weight) { |
|
1
|
50
|
0
|
1
|
|
3
|
|
|
1
|
50
|
|
1
|
|
107
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
327
|
|
|
1
|
|
|
|
|
1195
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
50
|
1
|
50
|
|
|
|
34
|
return Map::Metro::Graph->new(filepath => $self->filepath, |
51
|
|
|
|
|
|
|
wanted_hook_plugins => [$self->all_hooks], |
52
|
|
|
|
|
|
|
defined $override_line_change_weight ? (override_line_change_weight => $override_line_change_weight) : (), |
53
|
|
|
|
|
|
|
)->parse; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=pod |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=encoding UTF-8 |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 NAME |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Map::Metro::Shim - Easily load a map file |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 VERSION |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Version 0.2300, released 2016-01-14. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 SYNOPSIS |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
use Map::Metro::Shim; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
my $graph = Map::Metro::Shim->new('../path/to/mapfile.txt')->parse; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 DESCRIPTION |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
If you want to test a map file without creating a module, use this class instead of L<Map::Metro> and pass the path to the map file. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 Methods |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head3 new($filepath) |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
B<C<$filepath>> |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
The path to the map file. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Apart from that this module works just like L<Map::Metro>. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 SEE ALSO |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
L<Map::Metro> |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 SOURCE |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
L<https://github.com/Csson/p5-Map-Metro> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 HOMEPAGE |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
L<https://metacpan.org/release/Map-Metro> |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 AUTHOR |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Erik Carlsson <info@code301.com> |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
This software is copyright (c) 2016 by Erik Carlsson. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
114
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=cut |