diff --git a/Build.PL b/Build.PL index 3fa2b19b3df48aab673ec8549345ba1476c0bd96..528883bf54edd0d677b2e950201064a5083bb3af 100644 --- a/Build.PL +++ b/Build.PL @@ -12,7 +12,7 @@ my %opts = ( 'Test::Command' => 0, 'Test::Synopsis' => 0, }, - module_name => 'WWW::Efa', + module_name => 'Net::Travel::DE::VRR', license => 'unrestricted', requires => { 'perl' => '5.10.0', diff --git a/bin/efa b/bin/efa index c97f4f1e52975eb21e7e58e21a8f926c5665115b..820ff52189558aaa4472a3bdd89f0cbce90ee1d9 100755 --- a/bin/efa +++ b/bin/efa @@ -6,8 +6,8 @@ use strict; use warnings; use 5.010; +use Net::Travel::DE::VRR; use Getopt::Long qw/:config no_ignore_case/; -use WWW::Efa; our $VERSION = '1.3'; my $ignore_info = 'Fahrradmitnahme'; @@ -78,7 +78,7 @@ for my $pair ( [ \@from, \$from_type ], [ \@via, \$via_type ], } } -$efa = WWW::Efa->new( +$efa = Net::Travel::DE::VRR->new( from => [ @from, $from_type ], to => [ @to, $to_type ], via => ( @via ? [ @via, $via_type ] : undef ), diff --git a/lib/WWW/Efa.pm b/lib/Net/Travel/DE/VRR.pm similarity index 97% rename from lib/WWW/Efa.pm rename to lib/Net/Travel/DE/VRR.pm index 99c3181afa61b91fc2dd408f0f607049f4c835a4..5d330fdd6b81dc46388b88aaf7fd9b72d115d428 100644 --- a/lib/WWW/Efa.pm +++ b/lib/Net/Travel/DE/VRR.pm @@ -1,4 +1,4 @@ -package WWW::Efa; +package Net::Travel::DE::VRR; use strict; use warnings; @@ -482,13 +482,13 @@ __END__ =head1 NAME -WWW::Efa - inofficial interface to the efa.vrr.de German itinerary service +Net::Travel::DE::VRR - inofficial interface to the efa.vrr.de German itinerary service =head1 SYNOPSIS - use WWW::Efa; + use Net::Travel::DE::VRR; - my $efa = WWW::Efa->new( + my $efa = Net::Travel::DE::VRR->new( from => ['Essen', 'HBf'], to => ['Duisburg', 'HBf'], ); @@ -513,7 +513,7 @@ version 1.3 =head1 DESCRIPTION -B is a client for the efa.vrr.de web interface. +B is a client for the efa.vrr.de web interface. You pass it the start/stop of your journey, maybe a time and a date and more details, and it returns the up-to-date scheduled connections between those two stops. @@ -524,9 +524,9 @@ It uses B and B for this. =over -=item $efa = WWW::Efa->new(I<%conf>) +=item $efa = Net::Travel::DE::VRR->new(I<%conf>) -Returns a new WWW::Efa object and sets up its POST data via %conf. +Returns a new Net::Travel::DE::VRR object and sets up its POST data via %conf. Valid hash keys and their values are: @@ -652,7 +652,7 @@ Dies with a backtrace when anything goes wrong. The parser is still somewhat fragile and has no proper error handling. -It is best not to pass Unicode characters to B. +It is best not to pass Unicode characters to B. =head1 AUTHOR diff --git a/t/02-synopsis.t b/t/02-synopsis.t index 3b5f0c88309e8925ab3489713e893301e35f0083..fb2b63f9b3a2b54b17b8c8f73c5ac2dd17156771 100644 --- a/t/02-synopsis.t +++ b/t/02-synopsis.t @@ -9,10 +9,5 @@ eval "use Test::Synopsis"; if ($@) { plan skip_all => 'Test::Synopsis required for testing'; } -else { - plan tests => 1; -} -for my $m (qw(lib/WWW/Efa.pm)) { - synopsis_ok($m); -} +all_synopsis_ok(); diff --git a/t/50-www-efa.t b/t/20-vrr.t similarity index 96% rename from t/50-www-efa.t rename to t/20-vrr.t index 29e4af5480422ec7db4d8d1c3ad04e03f2ee2e28..86422c130b552cac044b57d36d738090edc38d0f 100644 --- a/t/50-www-efa.t +++ b/t/20-vrr.t @@ -6,9 +6,9 @@ use 5.010; use Test::More tests => 59; BEGIN { - use_ok('WWW::Efa'); + use_ok('Net::Travel::DE::VRR'); } -require_ok('WWW::Efa'); +require_ok('Net::Travel::DE::VRR'); sub efa_conf { my $ret = { @@ -23,7 +23,7 @@ sub efa_conf { sub efa_new { return new_ok( - 'WWW::Efa' => [%{efa_conf(@_)}] + 'Net::Travel::DE::VRR' => [%{efa_conf(@_)}] ); } diff --git a/t/out/ambiguous b/t/out/ambiguous deleted file mode 100644 index 787b3fdb5489faee3e431d8a759e74893c09b6e4..0000000000000000000000000000000000000000 --- a/t/out/ambiguous +++ /dev/null @@ -1,4 +0,0 @@ -WWW::Efa error: ambiguous input for name_origin: - Bredeney - Bredeney Friedhof - Bredeneyer Kreuz diff --git a/t/out/invalid_input b/t/out/invalid_input deleted file mode 100644 index 2d22895b69b1cc9850f7cafb73cfab4fc9146748..0000000000000000000000000000000000000000 --- a/t/out/invalid_input +++ /dev/null @@ -1 +0,0 @@ -WWW::Efa error: No data returned by efa.vrr.de diff --git a/t/out/no_connections b/t/out/no_connections deleted file mode 100644 index f081ab70c5ec43544b8b4859e8dd8079884d7e65..0000000000000000000000000000000000000000 --- a/t/out/no_connections +++ /dev/null @@ -1,5 +0,0 @@ -WWW::Efa error from efa.vrr.de: - -Leider konnte für Ihre Anfrage keine Verbindung gefunden werden! Bitte ändern Sie Ihre Eingabe (z.B. Fußwegezeit in den Mobilitätseinstellungen) oder starten Sie eine neue Anfrage! - -