line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- perl -*-
|
2
|
|
|
|
|
|
|
#
|
3
|
|
|
|
|
|
|
# Author: Gisbert W. Selke, TapirSoft Selke & Selke GbR.
|
4
|
|
|
|
|
|
|
#
|
5
|
|
|
|
|
|
|
# Copyright (C) 2015 Gisbert W. Selke. All rights reserved.
|
6
|
|
|
|
|
|
|
# This package is free software; you can redistribute it and/or
|
7
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself.
|
8
|
|
|
|
|
|
|
#
|
9
|
|
|
|
|
|
|
# Mail: gws@cpan.org
|
10
|
|
|
|
|
|
|
#
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Map::Tube::Lyon;
|
13
|
1
|
|
|
1
|
|
29877
|
use strict;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
66
|
|
14
|
1
|
|
|
1
|
|
8
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
75
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.05';
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=encoding utf8
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Map::Tube::Lyon - Interface to the Lyon metro map
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=cut
|
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
|
713
|
use File::Share ':all';
|
|
1
|
|
|
|
|
11616
|
|
|
1
|
|
|
|
|
384
|
|
27
|
1
|
|
|
1
|
|
1003
|
use Moo;
|
|
1
|
|
|
|
|
21621
|
|
|
1
|
|
|
|
|
9
|
|
28
|
1
|
|
|
1
|
|
3187
|
use namespace::clean;
|
|
1
|
|
|
|
|
16608
|
|
|
1
|
|
|
|
|
9
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
has xml => ( is => 'ro', default => sub { return dist_file( 'Map-Tube-Lyon', 'lyon-map.xml' ) } );
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
with 'Map::Tube';
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
use Map::Tube::Lyon;
|
37
|
|
|
|
|
|
|
my $tube = Map::Tube::Lyon->new();
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my $route = $tube->get_shortest_route('Foch', 'Gorge de Loup');
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
print "Route: $route\n";
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
This module allows to find the shortest route between any two given métro
|
46
|
|
|
|
|
|
|
stations in Lyon. All interesting methods are provided by the role L.
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 METHODS
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 CONSTRUCTOR
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
use Map::Tube::Lyon;
|
53
|
|
|
|
|
|
|
my $tube = Map::Tube::Lyon->new();
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
The only argument, C, is optional; if specified, it should be a code ref
|
56
|
|
|
|
|
|
|
to a function that returns either the path the XML map file, or a string
|
57
|
|
|
|
|
|
|
containing this XML content. The default is the path to F
|
58
|
|
|
|
|
|
|
that is a part of this distribution. For further information see L.
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 xml()
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
This read-only accessor returns whatever was specified as the XML source at
|
63
|
|
|
|
|
|
|
construction.
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 ERRORS
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
If something goes wrong, maybe because the map information file was corrupted,
|
68
|
|
|
|
|
|
|
the constructor will die.
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 AUTHOR
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Gisbert W. Selke, TapirSoft Selke & Selke GbR.
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
The data for the XML file were taken from the French-language Wikipedia,
|
77
|
|
|
|
|
|
|
entry "Liste des stations du métro de Lyon". It is CC BY-SA. The module
|
78
|
|
|
|
|
|
|
itself is free software; you may redistribute and/or modify it under the
|
79
|
|
|
|
|
|
|
same terms as Perl itself.
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 SEE ALSO
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
L, L.
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1;
|