Loading Changelog +4 −0 Original line number Original line Diff line number Diff line git HEAD * IRIS->new: Add optional argument lookbehind Travel::Status::DE::IRIS 1.13 - Thu Jan 26 2017 Travel::Status::DE::IRIS 1.13 - Thu Jan 26 2017 * Fix support for line numbers, remove manual line map workaround * Fix support for line numbers, remove manual line map workaround Loading lib/Travel/Status/DE/IRIS.pm +11 −4 Original line number Original line Diff line number Diff line Loading @@ -35,9 +35,10 @@ sub new { developer_mode => $opt{developer_mode}, developer_mode => $opt{developer_mode}, iris_base => $opt{iris_base} iris_base => $opt{iris_base} // 'http://iris.noncd.db.de/iris-tts/timetable', // 'http://iris.noncd.db.de/iris-tts/timetable', lookahead => $opt{lookahead} // ( 4 * 60 ), lookahead => $opt{lookahead} // ( 4 * 60 ), main_cache => $opt{main_cache}, lookbehind => $opt{lookbehind} // ( 0 * 60 ), rt_cache => $opt{realtime_cache}, main_cache => $opt{main_cache}, rt_cache => $opt{realtime_cache}, serializable => $opt{serializable}, serializable => $opt{serializable}, user_agent => $ua, user_agent => $ua, with_related => $opt{with_related}, with_related => $opt{with_related}, Loading Loading @@ -67,6 +68,7 @@ sub new { datetime => $self->{datetime}, datetime => $self->{datetime}, developer_mode => $self->{developer_mode}, developer_mode => $self->{developer_mode}, lookahead => $self->{lookahead}, lookahead => $self->{lookahead}, lookbehind => $self->{lookbehind}, station => $ref->{uic}, station => $ref->{uic}, main_cache => $self->{main_cache}, main_cache => $self->{main_cache}, realtime_cache => $self->{rt_cache}, realtime_cache => $self->{rt_cache}, Loading @@ -82,10 +84,15 @@ sub new { } } my $dt_req = $self->{datetime}->clone; my $dt_req = $self->{datetime}->clone; for ( 1 .. 3 ) { for ( 1 .. int( $self->{lookahead} / 60 ) ) { $self->get_timetable( $self->{station}{uic}, $dt_req ); $self->get_timetable( $self->{station}{uic}, $dt_req ); $dt_req->add( hours => 1 ); $dt_req->add( hours => 1 ); } } $dt_req = $self->{datetime}->clone; for ( 1 .. int( $self->{lookbehind} / 60 ) ) { $dt_req->subtract( hours => 1 ); $self->get_timetable( $self->{station}{uic}, $dt_req ); } $self->get_realtime; $self->get_realtime; Loading t/20-iris-class.t +2 −1 Original line number Original line Diff line number Diff line Loading @@ -21,7 +21,8 @@ my $status = Travel::Status::DE::IRIS->new( hour => 20, hour => 20, minute => 1, minute => 1, time_zone => 'Europe/Berlin', time_zone => 'Europe/Berlin', ) ), lookahead => 3 * 60 + 59, ); ); isa_ok( $status, 'Travel::Status::DE::IRIS' ); isa_ok( $status, 'Travel::Status::DE::IRIS' ); Loading t/31-result-basics.t +2 −1 Original line number Original line Diff line number Diff line Loading @@ -20,7 +20,8 @@ my $status = Travel::Status::DE::IRIS->new( hour => 20, hour => 20, minute => 1, minute => 1, time_zone => 'Europe/Berlin' time_zone => 'Europe/Berlin' ) ), lookahead => 3 * 60 + 59, ); ); my @results = $status->results; my @results = $status->results; Loading Loading
Changelog +4 −0 Original line number Original line Diff line number Diff line git HEAD * IRIS->new: Add optional argument lookbehind Travel::Status::DE::IRIS 1.13 - Thu Jan 26 2017 Travel::Status::DE::IRIS 1.13 - Thu Jan 26 2017 * Fix support for line numbers, remove manual line map workaround * Fix support for line numbers, remove manual line map workaround Loading
lib/Travel/Status/DE/IRIS.pm +11 −4 Original line number Original line Diff line number Diff line Loading @@ -35,9 +35,10 @@ sub new { developer_mode => $opt{developer_mode}, developer_mode => $opt{developer_mode}, iris_base => $opt{iris_base} iris_base => $opt{iris_base} // 'http://iris.noncd.db.de/iris-tts/timetable', // 'http://iris.noncd.db.de/iris-tts/timetable', lookahead => $opt{lookahead} // ( 4 * 60 ), lookahead => $opt{lookahead} // ( 4 * 60 ), main_cache => $opt{main_cache}, lookbehind => $opt{lookbehind} // ( 0 * 60 ), rt_cache => $opt{realtime_cache}, main_cache => $opt{main_cache}, rt_cache => $opt{realtime_cache}, serializable => $opt{serializable}, serializable => $opt{serializable}, user_agent => $ua, user_agent => $ua, with_related => $opt{with_related}, with_related => $opt{with_related}, Loading Loading @@ -67,6 +68,7 @@ sub new { datetime => $self->{datetime}, datetime => $self->{datetime}, developer_mode => $self->{developer_mode}, developer_mode => $self->{developer_mode}, lookahead => $self->{lookahead}, lookahead => $self->{lookahead}, lookbehind => $self->{lookbehind}, station => $ref->{uic}, station => $ref->{uic}, main_cache => $self->{main_cache}, main_cache => $self->{main_cache}, realtime_cache => $self->{rt_cache}, realtime_cache => $self->{rt_cache}, Loading @@ -82,10 +84,15 @@ sub new { } } my $dt_req = $self->{datetime}->clone; my $dt_req = $self->{datetime}->clone; for ( 1 .. 3 ) { for ( 1 .. int( $self->{lookahead} / 60 ) ) { $self->get_timetable( $self->{station}{uic}, $dt_req ); $self->get_timetable( $self->{station}{uic}, $dt_req ); $dt_req->add( hours => 1 ); $dt_req->add( hours => 1 ); } } $dt_req = $self->{datetime}->clone; for ( 1 .. int( $self->{lookbehind} / 60 ) ) { $dt_req->subtract( hours => 1 ); $self->get_timetable( $self->{station}{uic}, $dt_req ); } $self->get_realtime; $self->get_realtime; Loading
t/20-iris-class.t +2 −1 Original line number Original line Diff line number Diff line Loading @@ -21,7 +21,8 @@ my $status = Travel::Status::DE::IRIS->new( hour => 20, hour => 20, minute => 1, minute => 1, time_zone => 'Europe/Berlin', time_zone => 'Europe/Berlin', ) ), lookahead => 3 * 60 + 59, ); ); isa_ok( $status, 'Travel::Status::DE::IRIS' ); isa_ok( $status, 'Travel::Status::DE::IRIS' ); Loading
t/31-result-basics.t +2 −1 Original line number Original line Diff line number Diff line Loading @@ -20,7 +20,8 @@ my $status = Travel::Status::DE::IRIS->new( hour => 20, hour => 20, minute => 1, minute => 1, time_zone => 'Europe/Berlin' time_zone => 'Europe/Berlin' ) ), lookahead => 3 * 60 + 59, ); ); my @results = $status->results; my @results = $status->results; Loading