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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +1 -1
  3. data/.ruby-version +1 -0
  4. data/Gemfile.lock +147 -49
  5. data/LICENSE +1 -1
  6. data/README.md +17 -11
  7. data/doc/LICENSE.html +403 -47
  8. data/doc/Ldbws/Request/GetDeparturesBoard.html +487 -54
  9. data/doc/Ldbws/Request/GetDeparturesBoardWithDetails.html +487 -54
  10. data/doc/Ldbws/Request/GetServiceDetails.html +484 -51
  11. data/doc/Ldbws/Request/GetStationBoard.html +489 -56
  12. data/doc/Ldbws/Request/GetStationBoardWithDetails.html +489 -56
  13. data/doc/Ldbws/Request/ParamValidationError.html +538 -69
  14. data/doc/Ldbws/Request.html +470 -47
  15. data/doc/Ldbws/RequestError.html +535 -72
  16. data/doc/Ldbws/ResponseParsingError.html +475 -49
  17. data/doc/Ldbws/ResponseTypes/BaseStationBoard.html +565 -56
  18. data/doc/Ldbws/ResponseTypes/CallingPoint.html +498 -65
  19. data/doc/Ldbws/ResponseTypes/Coach.html +487 -54
  20. data/doc/Ldbws/ResponseTypes/DepartureItem.html +485 -52
  21. data/doc/Ldbws/ResponseTypes/DepartureItemWithDetails.html +485 -52
  22. data/doc/Ldbws/ResponseTypes/DeparturesBoard.html +484 -51
  23. data/doc/Ldbws/ResponseTypes/DeparturesBoardWithDetails.html +484 -51
  24. data/doc/Ldbws/ResponseTypes/Formation.html +485 -52
  25. data/doc/Ldbws/ResponseTypes/LoadingCategory.html +486 -53
  26. data/doc/Ldbws/ResponseTypes/Location.html +486 -53
  27. data/doc/Ldbws/ResponseTypes/ServiceDetails.html +510 -77
  28. data/doc/Ldbws/ResponseTypes/ServiceItem.html +503 -70
  29. data/doc/Ldbws/ResponseTypes/ServiceItemWithCallingPoints.html +485 -52
  30. data/doc/Ldbws/ResponseTypes/StationBoard.html +486 -53
  31. data/doc/Ldbws/ResponseTypes/StationBoardWithDetails.html +486 -53
  32. data/doc/Ldbws/ResponseTypes/ToiletAvailability.html +485 -52
  33. data/doc/Ldbws/ResponseTypes.html +470 -47
  34. data/doc/Ldbws/Service.html +1083 -245
  35. data/doc/Ldbws.html +520 -73
  36. data/doc/README_md.html +14 -20
  37. data/doc/created.rid +19 -20
  38. data/doc/css/rdoc.css +1926 -378
  39. data/doc/index.html +441 -108
  40. data/doc/js/aliki.js +489 -0
  41. data/doc/js/bash_highlighter.js +167 -0
  42. data/doc/js/c_highlighter.js +299 -0
  43. data/doc/js/navigation.js.gz +0 -0
  44. data/doc/js/search_controller.js +129 -0
  45. data/doc/js/search_data.js +1 -0
  46. data/doc/js/search_index.js +1 -1
  47. data/doc/js/search_index.js.gz +0 -0
  48. data/doc/js/search_navigation.js +105 -0
  49. data/doc/js/search_ranker.js +239 -0
  50. data/doc/js/searcher.js.gz +0 -0
  51. data/doc/js/theme-toggle.js +112 -0
  52. data/doc/table_of_contents.html +2 -3
  53. data/ldbws.gemspec +7 -6
  54. data/lib/ldbws/request/base.rb +0 -3
  55. data/lib/ldbws/request/get_departures_board.rb +5 -1
  56. data/lib/ldbws/request/get_service_details.rb +5 -1
  57. data/lib/ldbws/request/get_station_board.rb +14 -1
  58. data/lib/ldbws/response_types/calling_point.rb +2 -2
  59. data/lib/ldbws/response_types/station_board.rb +6 -0
  60. data/lib/ldbws/service.rb +2 -4
  61. data/lib/ldbws/version.rb +1 -1
  62. data/spec/helpers/request_helper.rb +27 -0
  63. data/spec/request/get_departures_board_spec.rb +55 -0
  64. data/spec/request/get_service_details_spec.rb +16 -0
  65. data/spec/request/get_station_board_spec.rb +73 -0
  66. metadata +29 -21
  67. 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-ruby">ldbws-ruby</a>
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-ruby">ldbws-ruby<span><a href="#label-ldbws-ruby">&para;</a> <a href="#top">&uarr;</a></span></h1>
107
+ <h1 id="label-ldbws">ldbws<span><a href="#label-ldbws">&para;</a> <a href="#top">&uarr;</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>I’ll write a proper readme/howto at some point, but short version is that this is a Ruby wrapper around <a href="https://lite.realtime.nationalrail.co.uk/OpenLDBWS/">Network Rail‘s Live Departure Board web service</a> (LDBWS/OpenLDBWS)—I’ve trawled through their XSD files so you don’t have to =)</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
- <p>I built it for a project I’m hacking at + thought I’d release it into the world. It’s rough and ready right now, but it should be somewhat functional.</p>
113
+ <h2 id="label-Installation-2Fusage">Installation/usage<span><a href="#label-Installation-2Fusage">&para;</a> <a href="#top">&uarr;</a></span></h2>
121
114
 
122
- <h2 id="label-HOWTO">HOWTO<span><a href="#label-HOWTO">&para;</a> <a href="#top">&uarr;</a></span></h2>
115
+ <p>Add <code>ldbws</code> to your Gemfile</p>
123
116
 
124
- <p>All operations are supported, in <code>snake_case</code>, thus:</p>
117
+ <pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">&quot;ldbws&quot;</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">&quot;ldbws&quot;</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">&quot;CDF&quot;</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">&quot;CDF&quot;</span>) <span class="ruby-comment"># ie GetDepartureBoard</span>
130
126
 
131
127
  <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;TIME PLAT TO&quot;</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
- <h3 id="label-A+note+about+rate+limiting">A note about rate limiting<span><a href="#label-A+note+about+rate+limiting">&para;</a> <a href="#top">&uarr;</a></span></h3>
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">&para;</a> <a href="#top">&uarr;</a></span></h2>
156
150
 
data/doc/created.rid CHANGED
@@ -1,20 +1,19 @@
1
- Mon, 03 Apr 2023 16:59:36 +0100
2
- LICENSE Thu, 06 Oct 2022 18:25:44 +0100
3
- README.md Mon, 03 Apr 2023 16:32:49 +0100
4
- ldbws-1.0.1.gem Mon, 03 Apr 2023 16:34:55 +0100
5
- lib/ldbws/request/base.rb Mon, 03 Apr 2023 16:32:49 +0100
6
- lib/ldbws/request/get_departures_board.rb Sat, 01 Apr 2023 18:55:20 +0100
7
- lib/ldbws/request/get_service_details.rb Sat, 01 Apr 2023 18:55:20 +0100
8
- lib/ldbws/request/get_station_board.rb Sat, 01 Apr 2023 18:55:20 +0100
9
- lib/ldbws/response_types/base.rb Sat, 01 Apr 2023 18:55:20 +0100
10
- lib/ldbws/response_types/calling_point.rb Sat, 01 Apr 2023 18:56:26 +0100
11
- lib/ldbws/response_types/departures_board.rb Sat, 01 Apr 2023 18:55:20 +0100
12
- lib/ldbws/response_types/formation.rb Sat, 01 Apr 2023 18:56:26 +0100
13
- lib/ldbws/response_types/parsing_functions.rb Sat, 01 Apr 2023 18:55:20 +0100
14
- lib/ldbws/response_types/service_details.rb Sat, 01 Apr 2023 18:56:26 +0100
15
- lib/ldbws/response_types/service_item.rb Sat, 01 Apr 2023 18:56:26 +0100
16
- lib/ldbws/response_types/station_board.rb Sat, 01 Apr 2023 18:55:20 +0100
17
- lib/ldbws/service.rb Mon, 03 Apr 2023 16:43:39 +0100
18
- lib/ldbws/utils.rb Sat, 01 Apr 2023 18:57:09 +0100
19
- lib/ldbws/version.rb Mon, 03 Apr 2023 16:59:33 +0100
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