From 5600e3863c9dc8b321e5f580a3e7bbd4c64da892 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 12 Oct 2015 13:44:12 +0200 Subject: add devmode option (moar debugging) --- lib/Travel/Status/DE/URA.pm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'lib/Travel/Status/DE/URA.pm') diff --git a/lib/Travel/Status/DE/URA.pm b/lib/Travel/Status/DE/URA.pm index 1a11d26..eb1c7de 100644 --- a/lib/Travel/Status/DE/URA.pm +++ b/lib/Travel/Status/DE/URA.pm @@ -32,13 +32,14 @@ sub new { my $self = { datetime => $opt{datetime} // DateTime->now( time_zone => 'Europe/Berlin' ), - ura_base => $opt{ura_base}, - ura_version => $opt{ura_version}, - full_routes => $opt{calculate_routes} // 0, - hide_past => $opt{hide_past} // 1, - stop => $opt{stop}, - via => $opt{via}, - post => { + developer_mode => $opt{developer_mode}, + ura_base => $opt{ura_base}, + ura_version => $opt{ura_version}, + full_routes => $opt{calculate_routes} // 0, + hide_past => $opt{hide_past} // 1, + stop => $opt{stop}, + via => $opt{via}, + post => { ReturnList => 'lineid,linename,directionid,destinationtext,vehicleid,' . 'tripid,estimatedtime,stopid,stoppointname' @@ -66,6 +67,10 @@ sub new { $self->{raw_str} = $response->decoded_content; + if ( $self->{developer_mode} ) { + say $self->{raw_str}; + } + # Fix encoding in case we're running through test files if ( substr( $self->{ura_instant_url}, 0, 5 ) eq 'file:' ) { $self->{raw_str} = encode( 'UTF-8', $self->{raw_str} ); -- cgit v1.2.3