chartmogul-ruby 1.4.0 → 1.4.1

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: 9374c3e5f0335ea291d6273b51ff0c3e213c6aef
4
- data.tar.gz: ddb280e6a5a98688d8a1d1febc9510427fbeed5d
2
+ SHA256:
3
+ metadata.gz: ce4f647e9c235970df04714cfaaf2e573321fbb2d0ce4cdfcb052d84dc17b68d
4
+ data.tar.gz: c99cbafb09f5d900661e819db34a83372eea1020ac41ea56287b30aa98a1423c
5
5
  SHA512:
6
- metadata.gz: 3336095bfc0a8b4d3ad142f17609b9cef8882ecc7f5c727963f60e7d4757d0575e99953cfb418e5c9f10d807e88526797b4a93a2a5034235674c776801abc046
7
- data.tar.gz: ebf5566dcaa6f476de2dcc68fe994a731cd7a18d1a04f62d2192aa540ec6deb7d44dcfa0cd0b7f0af9247e64dc8bc22a7f649246057bd55d30f7179e2138ca5e
6
+ metadata.gz: e198b430a78cbcce6c6e46563bce0954a5e115aae0e5e87550621ea5cc2f42e8fc4f39226812def76a92396f2427f2a6ce3882b5abd50eac412dc4ec57ed6511
7
+ data.tar.gz: 456e9d0cf65e079761109f2b62dc8ec51588ff64775d78bb84e0c82308076a94e3d109144d6966d158644baba6080017b9409aa8209b95c86f6325180a937b53
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/ping
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.15.4
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic ZHVtbXktdG9rZW46ZHVtbXktdG9rZW4=
16
+ response:
17
+ status:
18
+ code: 500
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ cache-control:
24
+ - private
25
+ content-length:
26
+ - '25'
27
+ content-type:
28
+ - text/plain; charset=utf-8
29
+ access-control-allow-origin:
30
+ - "*"
31
+ date:
32
+ - Tue, 10 Dec 2019 07:43:50 GMT
33
+ connection:
34
+ - close
35
+ body:
36
+ encoding: UTF-8
37
+ string: 500 Internal Server Error
38
+ http_version:
39
+ recorded_at: Tue, 10 Dec 2019 07:43:51 GMT
40
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/ping
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.15.4
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic ZHVtbXktdG9rZW46ZHVtbXktdG9rZW4=
16
+ response:
17
+ status:
18
+ code: 504
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ cache-control:
24
+ - private
25
+ content-length:
26
+ - '25'
27
+ content-type:
28
+ - text/plain; charset=utf-8
29
+ access-control-allow-origin:
30
+ - "*"
31
+ date:
32
+ - Tue, 10 Dec 2019 07:43:50 GMT
33
+ connection:
34
+ - close
35
+ body:
36
+ encoding: UTF-8
37
+ string: 504 Gateway Timeout Error
38
+ http_version:
39
+ recorded_at: Tue, 10 Dec 2019 07:43:51 GMT
40
+ recorded_with: VCR 3.0.3
@@ -13,6 +13,7 @@ require 'chartmogul/errors/forbidden_error'
13
13
  require 'chartmogul/errors/not_found_error'
14
14
  require 'chartmogul/errors/resource_invalid_error'
15
15
  require 'chartmogul/errors/schema_invalid_error'
16
+ require 'chartmogul/errors/server_error'
16
17
  require 'chartmogul/errors/unauthorized_error'
17
18
 
18
19
  require 'chartmogul/config_attributes'
@@ -66,6 +66,9 @@ module ChartMogul
66
66
  when 422
67
67
  message = "The #{resource_name} could not be created or updated."
68
68
  raise ChartMogul::ResourceInvalidError.new(message, http_status: 422, response: response)
69
+ when 500..504
70
+ message = 'ChartMogul API server response error'
71
+ raise ChartMogul::ServerError.new(message, http_status: http_status, response: response)
69
72
  else
70
73
  message = "#{resource_name} request error has occurred."
71
74
  raise ChartMogul::ChartMogulError.new(message, http_status: http_status, response: response)
@@ -0,0 +1,4 @@
1
+ module ChartMogul
2
+ class ServerError < ChartMogulError
3
+ end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module ChartMogul
2
- VERSION = '1.4.0'.freeze
2
+ VERSION = '1.4.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chartmogul-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Langenauer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-20 00:00:00.000000000 Z
11
+ date: 2019-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -196,6 +196,8 @@ files:
196
196
  - fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/behaves_like_Pageable/should_be_pageable.yml
197
197
  - fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/should_have_Subscription_entries.yml
198
198
  - fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_on_incorrect_credentials.yml
199
+ - fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_with_500_internal_server_error.yml
200
+ - fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_with_504_gateway_timeout_error.yml
199
201
  - fixtures/vcr_cassettes/ChartMogul_Ping/pings/when_credentials_correct.yml
200
202
  - fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_handles_a_422_error.yml
201
203
  - fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_interacts_with_the_API.yml
@@ -234,6 +236,7 @@ files:
234
236
  - lib/chartmogul/errors/not_found_error.rb
235
237
  - lib/chartmogul/errors/resource_invalid_error.rb
236
238
  - lib/chartmogul/errors/schema_invalid_error.rb
239
+ - lib/chartmogul/errors/server_error.rb
237
240
  - lib/chartmogul/errors/unauthorized_error.rb
238
241
  - lib/chartmogul/invoice.rb
239
242
  - lib/chartmogul/line_items/one_time.rb
@@ -281,8 +284,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
284
  - !ruby/object:Gem::Version
282
285
  version: '0'
283
286
  requirements: []
284
- rubyforge_project:
285
- rubygems_version: 2.6.14.4
287
+ rubygems_version: 3.0.6
286
288
  signing_key:
287
289
  specification_version: 4
288
290
  summary: Chartmogul API Ruby Client