recurly 2.17.4 → 2.17.5

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
2
  SHA256:
3
- metadata.gz: 4c2519fa63df09c6e8be1fbb2b8e3b1e5303581df3c2ba46052d1e6b084503ce
4
- data.tar.gz: ebbeaba42a6976405a68afa5741bc031ecf02d5db545d7e7beb47dfb04846baa
3
+ metadata.gz: 4728284a90311477585bd4e7a3cf2407c7d7a2001393c8024316edd0ddbae1c2
4
+ data.tar.gz: 92753965d6071f9ed65ab002157fa4a54781a24d3000379289d65efe7cd2062c
5
5
  SHA512:
6
- metadata.gz: 1b796d1e913080e0da389ae4204ba5ef3cca6aff4f847cb4e4bfb28f4b774e3cc1981c6348553b829f17ea00aed08b5384251214f6ec5cc8db5279d5a7909e73
7
- data.tar.gz: 06145b01639da1f736ce9275dcdad4bba660d44d2efc84539290955b3bb0507bae9d8a44f54f43a575a566ff3f354c89e323dc120a3a6ae58018799380b021b7
6
+ metadata.gz: ce42d3196f35961c328f9bcc66dddaaebe0b7ce8cf1695e3d133ecfd07ce7f9c53b3bded7edb9ac3379179b5be46b3bcb7603423a0698a92a795e786c853c7e1
7
+ data.tar.gz: 64c7477e0218508c7dedc7e390f7584466a0d7c61797a6841178b9b4b9848d589f34b84eb3e15e4d59637fc3a8517a13297acabcee62efe1a22bf811a332a03f
@@ -1038,9 +1038,17 @@ module Recurly
1038
1038
  def apply_errors(exception)
1039
1039
  @response = exception.response
1040
1040
  document = XML.new exception.response.body
1041
- document.each_element 'error' do |el|
1042
- attribute_path = el.attribute('field').value.split '.'
1043
- invalid! attribute_path[1, attribute_path.length], el.text
1041
+
1042
+ if document.root.name == 'error'
1043
+ # Single error is returned from the API
1044
+ attribute_path = document['symbol'].text.split '.'
1045
+ invalid! [attribute_path[1]], document['description'].text
1046
+ else
1047
+ # Array of errors was returned by the API
1048
+ document.each_element 'error' do |el|
1049
+ attribute_path = el.attribute('field').value.split '.'
1050
+ invalid! attribute_path[1, attribute_path.length], el.text
1051
+ end
1044
1052
  end
1045
1053
  end
1046
1054
 
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 17
5
- PATCH = 4
5
+ PATCH = 5
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recurly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.17.4
4
+ version: 2.17.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-11 00:00:00.000000000 Z
11
+ date: 2019-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -168,18 +168,38 @@ dependencies:
168
168
  version: '1'
169
169
  - !ruby/object:Gem::Dependency
170
170
  name: pry
171
+ requirement: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - "<"
174
+ - !ruby/object:Gem::Version
175
+ version: 0.11.0
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: 0.9.10
179
+ type: :development
180
+ prerelease: false
181
+ version_requirements: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - "<"
184
+ - !ruby/object:Gem::Version
185
+ version: 0.11.0
186
+ - - ">="
187
+ - !ruby/object:Gem::Version
188
+ version: 0.9.10
189
+ - !ruby/object:Gem::Dependency
190
+ name: pry-nav
171
191
  requirement: !ruby/object:Gem::Requirement
172
192
  requirements:
173
193
  - - "~>"
174
194
  - !ruby/object:Gem::Version
175
- version: '0'
195
+ version: 0.2.4
176
196
  type: :development
177
197
  prerelease: false
178
198
  version_requirements: !ruby/object:Gem::Requirement
179
199
  requirements:
180
200
  - - "~>"
181
201
  - !ruby/object:Gem::Version
182
- version: '0'
202
+ version: 0.2.4
183
203
  description: 'An API client library for Recurly: https://recurly.com'
184
204
  email: support@recurly.com
185
205
  executables: []