spaceborne 0.1.41 → 0.1.42

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30bd85963db86e76c6f72a21fa703b090ba6cb4573863a2d107e218b2bfe4ee3
4
- data.tar.gz: 495ea111c1e2205cc369f29ad28132f6a208d0547ff31b9894459f61eb87be17
3
+ metadata.gz: 66c180d30b3917866f8729f651f22862158acb805ac7411494afd9bfcd2b8387
4
+ data.tar.gz: 435b8c3d85815b31eb853c71f882ae2d5ccba9597f187d21bd39b9821741d62e
5
5
  SHA512:
6
- metadata.gz: 65f0d4a71631c24f05793e5a7b78654e2a5b66054f11342dd398614d2eccee8998ef1573ec673e1c245844b68cc7f3040f015f1a719899aac3c8da6eac9163aa
7
- data.tar.gz: dcca75d582460de8f3566a5de65bd6bc200446d493bbb9b2efc462008e7928c86bc450fc2caf2bfbef2203842b983143e478d0807e6bcc66ae7ea4efd65da620
6
+ metadata.gz: 01f34ca4e5cf037f0d5a33e5739f67e542409d9ce9acb6350009e937f435cc199ad136f95ae67e2f156801d453e4f1c99a93098d9b04e7341231f90bd4092ec6
7
+ data.tar.gz: bb5bf155fa4f106c410c680948b796506b53e3972f6d932ae8efd51660362a7de95de858a122689da2d7b05da6f09e43839779a4701d96335445461b044602c6
@@ -1,3 +1,3 @@
1
1
  module Spaceborne
2
- VERSION = '0.1.41'.freeze
2
+ VERSION = '0.1.42'.freeze
3
3
  end
data/lib/spaceborne.rb CHANGED
@@ -186,7 +186,9 @@ module Airborne
186
186
 
187
187
  def exception_path_adder(args, body)
188
188
  yield
189
- rescue RSpec::Expectations::ExpectationNotMetError, Airborne::ExpectationError => e
189
+ rescue RSpec::Expectations::ExpectationNotMetError,
190
+ ExpectationError,
191
+ Airborne::ExpectationError => e
190
192
  e.message << "\nexpect arguments: #{args}\ndata element: #{body}"
191
193
  raise e
192
194
  end
@@ -301,14 +303,20 @@ module Airborne
301
303
  ' from JSON response'
302
304
  end
303
305
 
306
+ def handle_missing_errors(type, path, sub_path, element, &block)
307
+ exception_path_adder({ type: type, path: sub_path }, element) do
308
+ get_by_path(make_sub_path_optional(path, sub_path), element, &block)
309
+ end
310
+ end
311
+
304
312
  def walk_with_path(type, index, path, parts, json, &block)
305
313
  last_error = nil
306
314
  item_count = json.length
307
315
  error_count = 0
308
316
  json.each do |element|
317
+ sub_path = parts[(index.next)...(parts.length)].join('.')
309
318
  begin
310
- sub_path = parts[(index.next)...(parts.length)].join('.')
311
- get_by_path(make_sub_path_optional(path, sub_path), element, &block)
319
+ handle_missing_errors(type, path, sub_path, element, &block)
312
320
  rescue Exception => e
313
321
  last_error = e
314
322
  error_count += 1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spaceborne
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.41
4
+ version: 0.1.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Williams
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-24 00:00:00.000000000 Z
11
+ date: 2021-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport