summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-10-20 10:02:12 +0200
committerDaniel Friesel <derf@finalrewind.org>2014-10-20 10:02:12 +0200
commit8a769cd36383f9af895bae370d478bf6b9dae999 (patch)
treea667701b091005b2aaf7869c170527e0c4c2c3a1
parent119c3e764ce09481fa09027ba2aacc444876b139 (diff)
Fix $result->delay accessor
-rw-r--r--Changelog1
-rw-r--r--lib/Travel/Status/DE/DeutscheBahn/Result.pm2
-rw-r--r--t/in/essen.html4
3 files changed, 4 insertions, 3 deletions
diff --git a/Changelog b/Changelog
index 31c9881..0174a9f 100644
--- a/Changelog
+++ b/Changelog
@@ -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&#252;nster(Westf)Hbf
<strong>6</strong><br />
</td>
<td class="ris">
-<span><span style="color:#f00;">ca.&nbsp;15&nbsp;Minuten&nbsp;sp&#228;ter</span></span>,<br/><span class="red">Grund: Stellwerksst&#246;rung /-ausfall</span></td>
+<span><span style="color:#f00;">ca. +15</span></span>,<br/><span class="red">Grund: Stellwerksst&#246;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.&nbsp;15&nbsp;Minuten&nbsp;sp&#228;ter</span></span>,<br/><span class="red">Grund: Stellwerksst&#246;rung /-ausfall</span></td>
+<span><span style="color:#f00;">ca. +15</span></span>,<br/><span class="red">Grund: Stellwerksst&#246;rung /-ausfall</span></td>
</tr>
<tr>
<td class="time">20:00</td>