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
@@ -0,0 +1,73 @@
1
+ require "spec_helper"
2
+ require "helpers/request_helper"
3
+
4
+ describe Ldbws::Request::GetStationBoard do
5
+ include RequestHelper
6
+
7
+ let (:subject) { Ldbws::Request::GetStationBoard }
8
+
9
+ context :validation do
10
+ context :crs do
11
+ it "requires the parameter" do
12
+ expect_error({}, :crs, "is missing")
13
+ end
14
+
15
+ it "enforces the length requirement" do
16
+ expect_error({ crs: "x" }, :crs, "length must be 3")
17
+ expect_error({ crs: "xxxx" }, :crs, "length must be 3")
18
+ end
19
+
20
+ it "works with something that looks like a CRS (inexhaustive validation)" do
21
+ expect_ok(crs: "xxx")
22
+ end
23
+ end
24
+
25
+ context :filter_crs do
26
+ it "enforces the length requirement" do
27
+ expect_error({ filter_crs: "x" }, :filter_crs, "length must be 3")
28
+ expect_error({ filter_crs: "xxxx" }, :filter_crs, "length must be 3")
29
+ end
30
+
31
+ it "works with something that looks like a CRS (inexhaustive validation)" do
32
+ expect_ok(crs: "xxx", filter_crs: "abc")
33
+ end
34
+ end
35
+
36
+ context :filter_type do
37
+ it "doesn’t allow arbitrary values" do
38
+ expect_error({ filter_type: "wibble" }, :filter_type, "must be one of: to, from")
39
+ end
40
+
41
+ it "allows real values" do
42
+ expect_ok(crs: "xxx", filter_type: "to")
43
+ end
44
+
45
+ it "is case-insensitive" do
46
+ expect_ok(crs: "xxx", filter_type: "from")
47
+ expect_ok(crs: "xxx", filter_type: "FROM")
48
+ expect_ok(crs: "xxx", filter_type: "fRoM")
49
+ end
50
+ end
51
+ end
52
+
53
+ context :to_soap do
54
+ it "upcases all CRSen" do
55
+ soap = to_soap_str(crs: "cdf", filter_crs: "swa")
56
+
57
+ expect(soap).to include("<crs>CDF</crs>")
58
+ expect(soap).to include("<filterCrs>SWA</filterCrs>")
59
+ end
60
+
61
+ it "downcases the filter_type" do
62
+ soap = to_soap_str(crs: "cdf", filter_crs: "swa", filter_type: "FROM")
63
+
64
+ expect(soap).to include("<filterType>from</filterType>")
65
+ end
66
+
67
+ it "removes filter_type if filter_crs is not set" do
68
+ soap = to_soap_str(crs: "cdf", filter_type: "from")
69
+
70
+ expect(soap).not_to include("<filterType>from</filterType>")
71
+ end
72
+ end
73
+ end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ldbws
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Pearse
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-04-03 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: dry-schema
@@ -16,94 +15,93 @@ dependencies:
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '1.13'
18
+ version: '1.16'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: '1.13'
25
+ version: '1.16'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: faraday
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: '2.7'
32
+ version: '2.15'
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: '2.7'
39
+ version: '2.15'
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: nokogiri
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - "~>"
46
45
  - !ruby/object:Gem::Version
47
- version: '1.14'
46
+ version: '1.19'
48
47
  type: :runtime
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
51
  - - "~>"
53
52
  - !ruby/object:Gem::Version
54
- version: '1.14'
53
+ version: '1.19'
55
54
  - !ruby/object:Gem::Dependency
56
55
  name: rdoc
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - "~>"
60
59
  - !ruby/object:Gem::Version
61
- version: 6.5.0
60
+ version: '8.1'
62
61
  type: :development
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
65
  - - "~>"
67
66
  - !ruby/object:Gem::Version
68
- version: 6.5.0
67
+ version: '8.1'
69
68
  - !ruby/object:Gem::Dependency
70
69
  name: rspec
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
72
  - - "~>"
74
73
  - !ruby/object:Gem::Version
75
- version: '3.11'
74
+ version: '3.13'
76
75
  type: :development
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
79
  - - "~>"
81
80
  - !ruby/object:Gem::Version
82
- version: '3.11'
81
+ version: '3.13'
83
82
  - !ruby/object:Gem::Dependency
84
83
  name: rufo
85
84
  requirement: !ruby/object:Gem::Requirement
86
85
  requirements:
87
86
  - - "~>"
88
87
  - !ruby/object:Gem::Version
89
- version: 0.13.0
88
+ version: '0.18'
90
89
  type: :development
91
90
  prerelease: false
92
91
  version_requirements: !ruby/object:Gem::Requirement
93
92
  requirements:
94
93
  - - "~>"
95
94
  - !ruby/object:Gem::Version
96
- version: 0.13.0
97
- description:
95
+ version: '0.18'
98
96
  email: hello@jonpearse.net
99
97
  executables: []
100
98
  extensions: []
101
99
  extra_rdoc_files: []
102
100
  files:
103
101
  - ".editorconfig"
104
- - ".envrc"
105
102
  - ".gitattributes"
106
103
  - ".gitignore"
104
+ - ".ruby-version"
107
105
  - Gemfile
108
106
  - Gemfile.lock
109
107
  - LICENSE
@@ -174,14 +172,22 @@ files:
174
172
  - doc/images/wrench_orange.png
175
173
  - doc/images/zoom.png
176
174
  - doc/index.html
175
+ - doc/js/aliki.js
176
+ - doc/js/bash_highlighter.js
177
+ - doc/js/c_highlighter.js
177
178
  - doc/js/darkfish.js
178
179
  - doc/js/navigation.js
179
180
  - doc/js/navigation.js.gz
180
181
  - doc/js/search.js
182
+ - doc/js/search_controller.js
183
+ - doc/js/search_data.js
181
184
  - doc/js/search_index.js
182
185
  - doc/js/search_index.js.gz
186
+ - doc/js/search_navigation.js
187
+ - doc/js/search_ranker.js
183
188
  - doc/js/searcher.js
184
189
  - doc/js/searcher.js.gz
190
+ - doc/js/theme-toggle.js
185
191
  - doc/table_of_contents.html
186
192
  - ldbws.gemspec
187
193
  - lib/ldbws.rb
@@ -200,13 +206,16 @@ files:
200
206
  - lib/ldbws/service.rb
201
207
  - lib/ldbws/utils.rb
202
208
  - lib/ldbws/version.rb
209
+ - spec/helpers/request_helper.rb
210
+ - spec/request/get_departures_board_spec.rb
211
+ - spec/request/get_service_details_spec.rb
212
+ - spec/request/get_station_board_spec.rb
203
213
  - spec/response_types/parsing_spec.rb
204
214
  - spec/spec_helper.rb
205
215
  homepage: https://github.com/jonpearse/ldbws-ruby
206
216
  licenses:
207
217
  - MIT
208
218
  metadata: {}
209
- post_install_message:
210
219
  rdoc_options: []
211
220
  require_paths:
212
221
  - lib
@@ -214,15 +223,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
214
223
  requirements:
215
224
  - - ">="
216
225
  - !ruby/object:Gem::Version
217
- version: '0'
226
+ version: '3.3'
218
227
  required_rubygems_version: !ruby/object:Gem::Requirement
219
228
  requirements:
220
229
  - - ">="
221
230
  - !ruby/object:Gem::Version
222
231
  version: '0'
223
232
  requirements: []
224
- rubygems_version: 3.4.6
225
- signing_key:
233
+ rubygems_version: 4.0.20
226
234
  specification_version: 4
227
235
  summary: Interface to the Network Rail OpenLDBS web service
228
236
  test_files: []
data/.envrc DELETED
@@ -1 +0,0 @@
1
- dotenv