companies-house-rest 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c10c7c1f7ca78088d0591f617d45313363cf90d4
4
- data.tar.gz: acaea65ec921f948c136602bccd8e78021113602
2
+ SHA256:
3
+ metadata.gz: cd7dc68ed4f5ec30bd01f9bd3c98305af71c84b9a8ec0cfe94f36e126e6ac691
4
+ data.tar.gz: d499188b852c72b801ccf32c13c04cb5ae6c71d22724d2ebd95940e5c172878d
5
5
  SHA512:
6
- metadata.gz: '086b4c67ac3620af41f88def0274db7878be9203bc964eb27694dfb6db75220311ba46f29f7fbc7ee8e3679d71451654359a55130f5b66746b2ce615eea4dd22'
7
- data.tar.gz: 2109f0235146ed2eeafa79b1e46ab371221d03c026afb36540b7f414f8ec360ead19e0e09be8e8d8b3cbb069a0f7e84f7b1018d49a9a0f9726c374c54a4bddbe
6
+ metadata.gz: 02c0c1dcdc464cd7173a461aa443f417eb91fd9b1d030d41c643acea9f410ec4c3f223ac6b2f684836c6b89378c67dd3f729a04d9761c9a62517bca3e529eaa6
7
+ data.tar.gz: 4a47367d243a9d2073814c7ca12a09705eefe7abd3b7661b15f421127980a81b9d214249ed3d8ee18e41b35d54fcffea88e775adc566c813e46ac681a51beaa2
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.bindir = "exe"
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
- spec.required_ruby_version = ">= 2.3"
23
+ spec.required_ruby_version = ">= 2.5.1"
24
24
 
25
25
  spec.add_runtime_dependency "activesupport", ">= 4.2", "< 6"
26
26
  spec.add_runtime_dependency "virtus", "~> 1.0", ">= 1.0.5"
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CompaniesHouse
4
+ # Raised when a request returned a 502
5
+ class BadGatewayError < APIError
6
+ def initialize(response = nil)
7
+ super("Bad gateway error", response)
8
+ end
9
+ end
10
+ end
@@ -14,6 +14,7 @@ module CompaniesHouse
14
14
 
15
15
  def initialize(config)
16
16
  raise ArgumentError, "Missing API key" unless config[:api_key]
17
+
17
18
  @api_key = config[:api_key]
18
19
  @endpoint = URI(config[:endpoint] || ENDPOINT)
19
20
  @open_timeout = config[:open_timeout] || 60
@@ -5,6 +5,7 @@ require "companies_house/not_found_error"
5
5
  require "companies_house/authentication_error"
6
6
  require "companies_house/rate_limit_error"
7
7
  require "companies_house/timeout_error"
8
+ require "companies_house/bad_gateway_error"
8
9
 
9
10
  require "virtus"
10
11
  require "uri"
@@ -88,6 +89,8 @@ module CompaniesHouse
88
89
  raise CompaniesHouse::NotFoundError.new(resource_type, resource_id, response)
89
90
  when "429"
90
91
  raise CompaniesHouse::RateLimitError, response
92
+ when "502"
93
+ raise CompaniesHouse::BadGatewayError, response
91
94
  else
92
95
  raise CompaniesHouse::APIError.new("Unknown API response", response)
93
96
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CompaniesHouse
4
- VERSION = "0.4.3"
4
+ VERSION = "0.4.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: companies-house-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless Engineering
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-06 00:00:00.000000000 Z
11
+ date: 2019-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -148,6 +148,7 @@ files:
148
148
  - lib/companies_house.rb
149
149
  - lib/companies_house/api_error.rb
150
150
  - lib/companies_house/authentication_error.rb
151
+ - lib/companies_house/bad_gateway_error.rb
151
152
  - lib/companies_house/client.rb
152
153
  - lib/companies_house/not_found_error.rb
153
154
  - lib/companies_house/rate_limit_error.rb
@@ -166,7 +167,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
167
  requirements:
167
168
  - - ">="
168
169
  - !ruby/object:Gem::Version
169
- version: '2.3'
170
+ version: 2.5.1
170
171
  required_rubygems_version: !ruby/object:Gem::Requirement
171
172
  requirements:
172
173
  - - ">="
@@ -174,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
175
  version: '0'
175
176
  requirements: []
176
177
  rubyforge_project:
177
- rubygems_version: 2.6.13
178
+ rubygems_version: 2.7.6
178
179
  signing_key:
179
180
  specification_version: 4
180
181
  summary: Look up UK company registration information