From 49bca5b7fafffc9dc42660fc13c7931cd243426d Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 14 Aug 2010 11:31:26 +0200 Subject: Remove 'time' option from WWW::Efa --- lib/WWW/Efa.pm | 9 +++++---- t/50-www-efa.t | 13 +++---------- t/60-bin-efa.t | 14 ++++++++++++-- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/lib/WWW/Efa.pm b/lib/WWW/Efa.pm index 0716d5e..0aa2f46 100644 --- a/lib/WWW/Efa.pm +++ b/lib/WWW/Efa.pm @@ -53,7 +53,7 @@ sub post_time { my ($post, $conf) = @_; my $time; - if ($conf->{'depart'} || $conf->{'time'}) { + if ($conf->{'depart'}) { $post->{'itdTripDateTimeDepArr'} = 'dep'; $time = $conf->{'depart'} || $conf->{'time'}; } @@ -64,7 +64,8 @@ sub post_time { if ($time !~ / ^ [0-2]? \d : [0-5]? \d $ /x) { die WWW::Efa::Error::Setup->new( - 'time', $time, 'Must match HH:MM' + ($conf->{'depart'} ? 'depart' : 'arrive'), + $time, 'Must match HH:MM' ); } @{$post}{'itdTimeHour', 'itdTimeMinute'} = split(/:/, $time); @@ -179,7 +180,7 @@ sub create_post { if ($conf->{'via'}) { post_place($post, 'via', @{$conf->{'via'}}); } - if ($conf->{'arrive'} || $conf->{'depart'} || $conf->{'time'}) { + if ($conf->{'arrive'} || $conf->{'depart'}) { post_time($post, $conf); } if ($conf->{'date'}) { @@ -343,7 +344,7 @@ contain. See B for arguments. Sets the journey end time -=item B|B