diff options
author | Daniel Friesel <derf@finalrewind.org> | 2014-10-20 10:02:12 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2014-10-20 10:02:12 +0200 |
commit | 8a769cd36383f9af895bae370d478bf6b9dae999 (patch) | |
tree | a667701b091005b2aaf7869c170527e0c4c2c3a1 | |
parent | 119c3e764ce09481fa09027ba2aacc444876b139 (diff) |
Fix $result->delay accessor
-rw-r--r-- | Changelog | 1 | ||||
-rw-r--r-- | lib/Travel/Status/DE/DeutscheBahn/Result.pm | 2 | ||||
-rw-r--r-- | t/in/essen.html | 4 |
3 files changed, 4 insertions, 3 deletions
@@ -1,6 +1,7 @@ git HEAD * Add primitive JSON serializer to Travel::Status::DE::DeutscheBahn::Result + * Fix $result->delay (changes in RIS output format) Travel::Status::DE::DeutscheBahn 1.02 - Tue Sep 17 2013 diff --git a/lib/Travel/Status/DE/DeutscheBahn/Result.pm b/lib/Travel/Status/DE/DeutscheBahn/Result.pm index 9c62a71..10f0f79 100644 --- a/lib/Travel/Status/DE/DeutscheBahn/Result.pm +++ b/lib/Travel/Status/DE/DeutscheBahn/Result.pm @@ -55,7 +55,7 @@ sub delay { if ( $info =~ m{ p.nktlich }ox ) { return 0; } - if ( $info =~ m{ ca[.] \s (?<delay> \d+ ) \s Minuten \s sp.ter }ox ) { + if ( $info =~ m{ (?: ca \. \s* )? \+ (?<delay> \d+) :? \s* }ox ) { return $+{delay}; } diff --git a/t/in/essen.html b/t/in/essen.html index 10ddaf5..246b430 100644 --- a/t/in/essen.html +++ b/t/in/essen.html @@ -1293,7 +1293,7 @@ Münster(Westf)Hbf <strong>6</strong><br /> </td> <td class="ris"> -<span><span style="color:#f00;">ca. 15 Minuten später</span></span>,<br/><span class="red">Grund: Stellwerksstörung /-ausfall</span></td> +<span><span style="color:#f00;">ca. +15</span></span>,<br/><span class="red">Grund: Stellwerksstörung /-ausfall</span></td> </tr> <tr> <td class="time">19:41</td> @@ -1906,7 +1906,7 @@ Hamburg-Altona <strong>4</strong><br /> </td> <td class="ris"> -<span><span style="color:#f00;">ca. 15 Minuten später</span></span>,<br/><span class="red">Grund: Stellwerksstörung /-ausfall</span></td> +<span><span style="color:#f00;">ca. +15</span></span>,<br/><span class="red">Grund: Stellwerksstörung /-ausfall</span></td> </tr> <tr> <td class="time">20:00</td> |