ldbws 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.editorconfig +1 -1
- data/.ruby-version +1 -0
- data/Gemfile.lock +147 -49
- data/LICENSE +1 -1
- data/README.md +17 -11
- data/doc/LICENSE.html +403 -47
- data/doc/Ldbws/Request/GetDeparturesBoard.html +487 -54
- data/doc/Ldbws/Request/GetDeparturesBoardWithDetails.html +487 -54
- data/doc/Ldbws/Request/GetServiceDetails.html +484 -51
- data/doc/Ldbws/Request/GetStationBoard.html +489 -56
- data/doc/Ldbws/Request/GetStationBoardWithDetails.html +489 -56
- data/doc/Ldbws/Request/ParamValidationError.html +538 -69
- data/doc/Ldbws/Request.html +470 -47
- data/doc/Ldbws/RequestError.html +535 -72
- data/doc/Ldbws/ResponseParsingError.html +475 -49
- data/doc/Ldbws/ResponseTypes/BaseStationBoard.html +565 -56
- data/doc/Ldbws/ResponseTypes/CallingPoint.html +498 -65
- data/doc/Ldbws/ResponseTypes/Coach.html +487 -54
- data/doc/Ldbws/ResponseTypes/DepartureItem.html +485 -52
- data/doc/Ldbws/ResponseTypes/DepartureItemWithDetails.html +485 -52
- data/doc/Ldbws/ResponseTypes/DeparturesBoard.html +484 -51
- data/doc/Ldbws/ResponseTypes/DeparturesBoardWithDetails.html +484 -51
- data/doc/Ldbws/ResponseTypes/Formation.html +485 -52
- data/doc/Ldbws/ResponseTypes/LoadingCategory.html +486 -53
- data/doc/Ldbws/ResponseTypes/Location.html +486 -53
- data/doc/Ldbws/ResponseTypes/ServiceDetails.html +510 -77
- data/doc/Ldbws/ResponseTypes/ServiceItem.html +503 -70
- data/doc/Ldbws/ResponseTypes/ServiceItemWithCallingPoints.html +485 -52
- data/doc/Ldbws/ResponseTypes/StationBoard.html +486 -53
- data/doc/Ldbws/ResponseTypes/StationBoardWithDetails.html +486 -53
- data/doc/Ldbws/ResponseTypes/ToiletAvailability.html +485 -52
- data/doc/Ldbws/ResponseTypes.html +470 -47
- data/doc/Ldbws/Service.html +1083 -245
- data/doc/Ldbws.html +520 -73
- data/doc/README_md.html +14 -20
- data/doc/created.rid +19 -20
- data/doc/css/rdoc.css +1926 -378
- data/doc/index.html +441 -108
- data/doc/js/aliki.js +489 -0
- data/doc/js/bash_highlighter.js +167 -0
- data/doc/js/c_highlighter.js +299 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search_controller.js +129 -0
- data/doc/js/search_data.js +1 -0
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/search_navigation.js +105 -0
- data/doc/js/search_ranker.js +239 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/js/theme-toggle.js +112 -0
- data/doc/table_of_contents.html +2 -3
- data/ldbws.gemspec +7 -6
- data/lib/ldbws/request/base.rb +0 -3
- data/lib/ldbws/request/get_departures_board.rb +5 -1
- data/lib/ldbws/request/get_service_details.rb +5 -1
- data/lib/ldbws/request/get_station_board.rb +14 -1
- data/lib/ldbws/response_types/calling_point.rb +2 -2
- data/lib/ldbws/response_types/station_board.rb +6 -0
- data/lib/ldbws/service.rb +2 -4
- data/lib/ldbws/version.rb +1 -1
- data/spec/helpers/request_helper.rb +27 -0
- data/spec/request/get_departures_board_spec.rb +55 -0
- data/spec/request/get_service_details_spec.rb +16 -0
- data/spec/request/get_station_board_spec.rb +73 -0
- metadata +29 -21
- data/.envrc +0 -1
data/doc/README_md.html
CHANGED
|
@@ -62,19 +62,10 @@
|
|
|
62
62
|
<ul class="link-list" role="directory">
|
|
63
63
|
<li>
|
|
64
64
|
<details open>
|
|
65
|
-
<summary> <a href="#label-ldbws
|
|
65
|
+
<summary> <a href="#label-ldbws">ldbws</a>
|
|
66
66
|
</summary>
|
|
67
67
|
<ul class="link-list" role="directory">
|
|
68
|
-
<li>
|
|
69
|
-
<details open>
|
|
70
|
-
<summary> <a href="#label-HOWTO">HOWTO</a>
|
|
71
|
-
</summary>
|
|
72
|
-
<ul class="link-list" role="directory">
|
|
73
|
-
<li> <a href="#label-A+note+about+rate+limiting">A note about rate limiting</a>
|
|
74
|
-
|
|
75
|
-
</ul>
|
|
76
|
-
</details>
|
|
77
|
-
</li>
|
|
68
|
+
<li> <a href="#label-Installation-2Fusage">Installation/usage</a>
|
|
78
69
|
<li>
|
|
79
70
|
<details open>
|
|
80
71
|
<summary> <a href="#label-Error-handling">Error-handling</a>
|
|
@@ -113,20 +104,25 @@
|
|
|
113
104
|
|
|
114
105
|
<main role="main" aria-label="Page README.md">
|
|
115
106
|
|
|
116
|
-
<h1 id="label-ldbws
|
|
107
|
+
<h1 id="label-ldbws">ldbws<span><a href="#label-ldbws">¶</a> <a href="#top">↑</a></span></h1>
|
|
108
|
+
|
|
109
|
+
<p>This is a wrapper around <a href="https://lite.realtime.nationalrail.co.uk/OpenLDBWS/">Network Rail‘s Live Departure Board web service</a> (LDBWS/OpenLDBWS), allowing a much simpler querying interface. As best I can tell, all functionality is supported, although the gem currently only queries the public API.</p>
|
|
117
110
|
|
|
118
|
-
<p>
|
|
111
|
+
<p>You will need to <a href="http://realtime.nationalrail.co.uk/OpenLDBWSRegistration/">register for an API key</a> in order to use this gem.</p>
|
|
119
112
|
|
|
120
|
-
<
|
|
113
|
+
<h2 id="label-Installation-2Fusage">Installation/usage<span><a href="#label-Installation-2Fusage">¶</a> <a href="#top">↑</a></span></h2>
|
|
121
114
|
|
|
122
|
-
<
|
|
115
|
+
<p>Add <code>ldbws</code> to your Gemfile</p>
|
|
123
116
|
|
|
124
|
-
<
|
|
117
|
+
<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">"ldbws"</span>
|
|
118
|
+
</pre>
|
|
119
|
+
|
|
120
|
+
<p>As long as you have an API key, you should be able to make requests against the service. Note that, per Ruby tradition, methods are written in <code>snake_case</code>, thus:</p>
|
|
125
121
|
|
|
126
122
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">"ldbws"</span>
|
|
127
123
|
|
|
128
124
|
<span class="ruby-identifier">service</span> = <span class="ruby-constant">Ldbws</span>.<span class="ruby-identifier">service</span>(<span class="ruby-constant">YOUR_API_TOKEN</span>)
|
|
129
|
-
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">service</span>.<span class="ruby-identifier">get_departure_board</span>(<span class="ruby-value">crs:</span> <span class="ruby-string">"CDF"</span>)
|
|
125
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">service</span>.<span class="ruby-identifier">get_departure_board</span>(<span class="ruby-value">crs:</span> <span class="ruby-string">"CDF"</span>) <span class="ruby-comment"># ie GetDepartureBoard</span>
|
|
130
126
|
|
|
131
127
|
<span class="ruby-identifier">puts</span> <span class="ruby-string">"TIME PLAT TO"</span>
|
|
132
128
|
<span class="ruby-identifier">result</span>.<span class="ruby-identifier">train_services</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">service</span><span class="ruby-operator">|</span>
|
|
@@ -148,9 +144,7 @@
|
|
|
148
144
|
<span class="ruby-comment"># [etc]</span>
|
|
149
145
|
</pre>
|
|
150
146
|
|
|
151
|
-
<
|
|
152
|
-
|
|
153
|
-
<p>LDBWS uses rate-limiting for free access: while this <em>probably</em> isn’t going to be an issue for the casual user, you may want to consider using a cache in front of this gem, just in case.</p>
|
|
147
|
+
<p>Basic validation/coercion of parameters is provided (via <a href="https://dry-rb.org/gems/dry-schema/">Dry::Schema</a>), but this is not exhaustive and should not be relied upon. In particular, CRS codes—the three letter identifier for each station—are <em>not</em> validated beyond “is it a three-letter string”.</p>
|
|
154
148
|
|
|
155
149
|
<h2 id="label-Error-handling">Error-handling<span><a href="#label-Error-handling">¶</a> <a href="#top">↑</a></span></h2>
|
|
156
150
|
|
data/doc/created.rid
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
LICENSE
|
|
3
|
-
README.md
|
|
4
|
-
ldbws-
|
|
5
|
-
lib/ldbws/request/
|
|
6
|
-
lib/ldbws/request/
|
|
7
|
-
lib/ldbws/request/
|
|
8
|
-
lib/ldbws/
|
|
9
|
-
lib/ldbws/response_types/
|
|
10
|
-
lib/ldbws/response_types/
|
|
11
|
-
lib/ldbws/response_types/
|
|
12
|
-
lib/ldbws/response_types/
|
|
13
|
-
lib/ldbws/response_types/
|
|
14
|
-
lib/ldbws/response_types/
|
|
15
|
-
lib/ldbws/response_types/
|
|
16
|
-
lib/ldbws/
|
|
17
|
-
lib/ldbws/
|
|
18
|
-
lib/ldbws/
|
|
19
|
-
lib/ldbws
|
|
20
|
-
lib/ldbws.rb Mon, 03 Apr 2023 16:32:49 +0100
|
|
1
|
+
Sat, 24 Oct 2026 13:55:07 +0100
|
|
2
|
+
/Users/jon/Software/@gems/ldbws-ruby/LICENSE Sat, 24 Oct 2026 13:54:56 +0100
|
|
3
|
+
/Users/jon/Software/@gems/ldbws-ruby/README.md Sat, 24 Oct 2026 13:53:47 +0100
|
|
4
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/request/base.rb Sat, 24 Oct 2026 13:52:39 +0100
|
|
5
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/request/get_departures_board.rb Sat, 24 Oct 2026 13:52:39 +0100
|
|
6
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/request/get_service_details.rb Sat, 24 Oct 2026 13:52:36 +0100
|
|
7
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/request/get_station_board.rb Sat, 24 Oct 2026 13:52:39 +0100
|
|
8
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/response_types/base.rb Sat, 24 Oct 2026 13:29:44 +0100
|
|
9
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/response_types/calling_point.rb Sat, 24 Oct 2026 13:52:41 +0100
|
|
10
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/response_types/departures_board.rb Sat, 24 Oct 2026 13:29:44 +0100
|
|
11
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/response_types/formation.rb Sat, 24 Oct 2026 13:29:44 +0100
|
|
12
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/response_types/parsing_functions.rb Sat, 24 Oct 2026 13:29:44 +0100
|
|
13
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/response_types/service_details.rb Sat, 24 Oct 2026 13:29:44 +0100
|
|
14
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/response_types/service_item.rb Sat, 24 Oct 2026 13:29:44 +0100
|
|
15
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/response_types/station_board.rb Sat, 24 Oct 2026 13:52:43 +0100
|
|
16
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/service.rb Sat, 24 Oct 2026 13:29:44 +0100
|
|
17
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/utils.rb Sat, 24 Oct 2026 13:29:44 +0100
|
|
18
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws/version.rb Sat, 24 Oct 2026 13:54:25 +0100
|
|
19
|
+
/Users/jon/Software/@gems/ldbws-ruby/lib/ldbws.rb Sat, 24 Oct 2026 13:29:44 +0100
|