line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
59316
|
use 5.10.0; |
|
1
|
|
|
|
|
14
|
|
2
|
1
|
|
|
1
|
|
9
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
82
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Map::Metro::Cmd::Mroute; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: Search in a map |
8
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY |
9
|
|
|
|
|
|
|
our $VERSION = '0.0200'; |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
430
|
use Moose; |
|
1
|
|
|
|
|
388678
|
|
|
1
|
|
|
|
|
5
|
|
12
|
1
|
|
|
1
|
|
6313
|
use MooseX::App::Command; |
|
1
|
|
|
|
|
393221
|
|
|
1
|
|
|
|
|
4
|
|
13
|
1
|
|
|
1
|
|
768579
|
use HTTP::Tiny; |
|
1
|
|
|
|
|
29324
|
|
|
1
|
|
|
|
|
37
|
|
14
|
1
|
|
|
1
|
|
316
|
use Types::Standard qw/Str/; |
|
1
|
|
|
|
|
54589
|
|
|
1
|
|
|
|
|
10
|
|
15
|
|
|
|
|
|
|
extends 'Map::Metro::Cmd'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
parameter cityname => ( |
18
|
|
|
|
|
|
|
is => 'rw', |
19
|
|
|
|
|
|
|
isa => Str, |
20
|
|
|
|
|
|
|
documentation => 'The name of the city you want to search in', |
21
|
|
|
|
|
|
|
required => 1, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
parameter origin => ( |
24
|
|
|
|
|
|
|
is => 'rw', |
25
|
|
|
|
|
|
|
isa => Str, |
26
|
|
|
|
|
|
|
documentation => 'Start station', |
27
|
|
|
|
|
|
|
required => 1, |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
parameter destination => ( |
30
|
|
|
|
|
|
|
is => 'rw', |
31
|
|
|
|
|
|
|
isa => Str, |
32
|
|
|
|
|
|
|
documentation => 'Final station', |
33
|
|
|
|
|
|
|
required => 1, |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
command_short_description 'Search in a map'; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub run { |
39
|
0
|
|
|
0
|
|
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my $url = sprintf 'http://localhost:3000/%s/%s/%s.txt', $self->cityname, $self->origin, $self->destination; |
42
|
0
|
|
|
|
|
|
my $content = HTTP::Tiny->new->get($url)->{'content'}; |
43
|
0
|
|
|
|
|
|
print $content; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=pod |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=encoding UTF-8 |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 NAME |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Map::Metro::Cmd::Mroute - Search in a map |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 VERSION |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Version 0.0200, released 2017-09-30. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 DESCRIPTION |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
See L<route|Map::Metro::Cmd/"map-metro.pl route $city $from $to">. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 AUTHOR |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Erik Carlsson <info@code301.com> |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This software is copyright (c) 2016 by Erik Carlsson. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
75
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |