companies-house-gateway 0.2.0 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +32 -3
  4. data/lib/companies_house_gateway/checks/check.rb +8 -3
  5. data/lib/companies_house_gateway/checks/company_appointments.rb +3 -3
  6. data/lib/companies_house_gateway/checks/document.rb +14 -2
  7. data/lib/companies_house_gateway/checks/mortgages.rb +3 -3
  8. data/lib/companies_house_gateway/checks/name_search.rb +1 -2
  9. data/lib/companies_house_gateway/checks/number_search.rb +1 -2
  10. data/lib/companies_house_gateway/checks/officer_details.rb +4 -3
  11. data/lib/companies_house_gateway/checks/officer_search.rb +2 -2
  12. data/lib/companies_house_gateway/client.rb +6 -5
  13. data/lib/companies_house_gateway/constants.rb +14 -0
  14. data/lib/companies_house_gateway/errors/api_error.rb +4 -0
  15. data/lib/companies_house_gateway/errors/invalid_request_error.rb +10 -0
  16. data/lib/companies_house_gateway/errors/invalid_response_error.rb +4 -0
  17. data/lib/companies_house_gateway/middleware/check_response.rb +29 -0
  18. data/lib/companies_house_gateway/request.rb +2 -1
  19. data/lib/companies_house_gateway/validations.rb +78 -0
  20. data/lib/companies_house_gateway/version.rb +1 -1
  21. data/lib/companies_house_gateway.rb +5 -0
  22. data/spec/checks/company_appointments_spec.rb +3 -3
  23. data/spec/checks/company_details_spec.rb +2 -1
  24. data/spec/checks/document_info_spec.rb +2 -1
  25. data/spec/checks/document_spec.rb +6 -3
  26. data/spec/checks/filing_history_spec.rb +2 -1
  27. data/spec/checks/mortgages_spec.rb +3 -3
  28. data/spec/checks/name_search_spec.rb +2 -1
  29. data/spec/checks/number_search_spec.rb +2 -1
  30. data/spec/checks/officer_details_spec.rb +2 -2
  31. data/spec/checks/officer_search_spec.rb +2 -2
  32. data/spec/fixtures/bad_response.xml +35 -0
  33. data/spec/fixtures/check_responses/company_appointments.xml +319 -0
  34. data/spec/fixtures/check_responses/company_details.xml +62 -0
  35. data/spec/fixtures/check_responses/document.xml +32 -0
  36. data/spec/fixtures/check_responses/document_info.xml +34 -0
  37. data/spec/fixtures/check_responses/filing_history.xml +57 -0
  38. data/spec/fixtures/check_responses/mortgages.xml +107 -0
  39. data/spec/fixtures/check_responses/name_search.xml +101 -0
  40. data/spec/fixtures/check_responses/number_search.xml +36 -0
  41. data/spec/fixtures/check_responses/officer_details.xml +65 -0
  42. data/spec/fixtures/check_responses/officer_search.xml +90 -0
  43. data/spec/fixtures/{checks → check_schemas}/chbase.xsd +0 -0
  44. data/spec/fixtures/{checks → check_schemas}/company_appointments.xsd +0 -0
  45. data/spec/fixtures/{checks → check_schemas}/company_details.xsd +0 -0
  46. data/spec/fixtures/{checks → check_schemas}/document.xsd +0 -0
  47. data/spec/fixtures/{checks → check_schemas}/document_info.xsd +0 -0
  48. data/spec/fixtures/{checks → check_schemas}/filing_history.xsd +0 -0
  49. data/spec/fixtures/{checks → check_schemas}/mortgages.xsd +0 -0
  50. data/spec/fixtures/{checks → check_schemas}/name_search.xsd +0 -0
  51. data/spec/fixtures/{checks → check_schemas}/number_search.xsd +0 -0
  52. data/spec/fixtures/{checks → check_schemas}/officer_details.xsd +0 -0
  53. data/spec/fixtures/{checks → check_schemas}/officer_search.xsd +0 -0
  54. data/spec/fixtures/response.xml +56 -0
  55. data/spec/request_spec.rb +24 -3
  56. data/spec/shared_examples.rb +20 -3
  57. data/spec/validations_spec.rb +157 -0
  58. metadata +55 -24
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: companies-house-gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grey Baker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-24 00:00:00.000000000 Z
11
+ date: 2014-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -122,9 +122,14 @@ files:
122
122
  - lib/companies_house_gateway/client.rb
123
123
  - lib/companies_house_gateway/config.rb
124
124
  - lib/companies_house_gateway/constants.rb
125
+ - lib/companies_house_gateway/errors/api_error.rb
125
126
  - lib/companies_house_gateway/errors/companies_house_gateway_error.rb
127
+ - lib/companies_house_gateway/errors/invalid_request_error.rb
128
+ - lib/companies_house_gateway/errors/invalid_response_error.rb
129
+ - lib/companies_house_gateway/middleware/check_response.rb
126
130
  - lib/companies_house_gateway/request.rb
127
131
  - lib/companies_house_gateway/util.rb
132
+ - lib/companies_house_gateway/validations.rb
128
133
  - lib/companies_house_gateway/version.rb
129
134
  - spec/checks/company_appointments_spec.rb
130
135
  - spec/checks/company_details_spec.rb
@@ -138,21 +143,34 @@ files:
138
143
  - spec/checks/officer_search_spec.rb
139
144
  - spec/client_spec.rb
140
145
  - spec/companies_house_gateway_spec.rb
141
- - spec/fixtures/checks/chbase.xsd
142
- - spec/fixtures/checks/company_appointments.xsd
143
- - spec/fixtures/checks/company_details.xsd
144
- - spec/fixtures/checks/document.xsd
145
- - spec/fixtures/checks/document_info.xsd
146
- - spec/fixtures/checks/filing_history.xsd
147
- - spec/fixtures/checks/mortgages.xsd
148
- - spec/fixtures/checks/name_search.xsd
149
- - spec/fixtures/checks/number_search.xsd
150
- - spec/fixtures/checks/officer_details.xsd
151
- - spec/fixtures/checks/officer_search.xsd
146
+ - spec/fixtures/bad_response.xml
147
+ - spec/fixtures/check_responses/company_appointments.xml
148
+ - spec/fixtures/check_responses/company_details.xml
149
+ - spec/fixtures/check_responses/document.xml
150
+ - spec/fixtures/check_responses/document_info.xml
151
+ - spec/fixtures/check_responses/filing_history.xml
152
+ - spec/fixtures/check_responses/mortgages.xml
153
+ - spec/fixtures/check_responses/name_search.xml
154
+ - spec/fixtures/check_responses/number_search.xml
155
+ - spec/fixtures/check_responses/officer_details.xml
156
+ - spec/fixtures/check_responses/officer_search.xml
157
+ - spec/fixtures/check_schemas/chbase.xsd
158
+ - spec/fixtures/check_schemas/company_appointments.xsd
159
+ - spec/fixtures/check_schemas/company_details.xsd
160
+ - spec/fixtures/check_schemas/document.xsd
161
+ - spec/fixtures/check_schemas/document_info.xsd
162
+ - spec/fixtures/check_schemas/filing_history.xsd
163
+ - spec/fixtures/check_schemas/mortgages.xsd
164
+ - spec/fixtures/check_schemas/name_search.xsd
165
+ - spec/fixtures/check_schemas/number_search.xsd
166
+ - spec/fixtures/check_schemas/officer_details.xsd
167
+ - spec/fixtures/check_schemas/officer_search.xsd
152
168
  - spec/fixtures/request.xsd
169
+ - spec/fixtures/response.xml
153
170
  - spec/request_spec.rb
154
171
  - spec/shared_examples.rb
155
172
  - spec/spec_helper.rb
173
+ - spec/validations_spec.rb
156
174
  homepage: https://github.com/gocardless/companies-house-gateway-ruby
157
175
  licenses: []
158
176
  metadata: {}
@@ -189,18 +207,31 @@ test_files:
189
207
  - spec/checks/officer_search_spec.rb
190
208
  - spec/client_spec.rb
191
209
  - spec/companies_house_gateway_spec.rb
192
- - spec/fixtures/checks/chbase.xsd
193
- - spec/fixtures/checks/company_appointments.xsd
194
- - spec/fixtures/checks/company_details.xsd
195
- - spec/fixtures/checks/document.xsd
196
- - spec/fixtures/checks/document_info.xsd
197
- - spec/fixtures/checks/filing_history.xsd
198
- - spec/fixtures/checks/mortgages.xsd
199
- - spec/fixtures/checks/name_search.xsd
200
- - spec/fixtures/checks/number_search.xsd
201
- - spec/fixtures/checks/officer_details.xsd
202
- - spec/fixtures/checks/officer_search.xsd
210
+ - spec/fixtures/bad_response.xml
211
+ - spec/fixtures/check_responses/company_appointments.xml
212
+ - spec/fixtures/check_responses/company_details.xml
213
+ - spec/fixtures/check_responses/document.xml
214
+ - spec/fixtures/check_responses/document_info.xml
215
+ - spec/fixtures/check_responses/filing_history.xml
216
+ - spec/fixtures/check_responses/mortgages.xml
217
+ - spec/fixtures/check_responses/name_search.xml
218
+ - spec/fixtures/check_responses/number_search.xml
219
+ - spec/fixtures/check_responses/officer_details.xml
220
+ - spec/fixtures/check_responses/officer_search.xml
221
+ - spec/fixtures/check_schemas/chbase.xsd
222
+ - spec/fixtures/check_schemas/company_appointments.xsd
223
+ - spec/fixtures/check_schemas/company_details.xsd
224
+ - spec/fixtures/check_schemas/document.xsd
225
+ - spec/fixtures/check_schemas/document_info.xsd
226
+ - spec/fixtures/check_schemas/filing_history.xsd
227
+ - spec/fixtures/check_schemas/mortgages.xsd
228
+ - spec/fixtures/check_schemas/name_search.xsd
229
+ - spec/fixtures/check_schemas/number_search.xsd
230
+ - spec/fixtures/check_schemas/officer_details.xsd
231
+ - spec/fixtures/check_schemas/officer_search.xsd
203
232
  - spec/fixtures/request.xsd
233
+ - spec/fixtures/response.xml
204
234
  - spec/request_spec.rb
205
235
  - spec/shared_examples.rb
206
236
  - spec/spec_helper.rb
237
+ - spec/validations_spec.rb