spaceborne 0.1.41 → 0.1.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spaceborne/version.rb +1 -1
- data/lib/spaceborne.rb +11 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66c180d30b3917866f8729f651f22862158acb805ac7411494afd9bfcd2b8387
|
4
|
+
data.tar.gz: 435b8c3d85815b31eb853c71f882ae2d5ccba9597f187d21bd39b9821741d62e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01f34ca4e5cf037f0d5a33e5739f67e542409d9ce9acb6350009e937f435cc199ad136f95ae67e2f156801d453e4f1c99a93098d9b04e7341231f90bd4092ec6
|
7
|
+
data.tar.gz: bb5bf155fa4f106c410c680948b796506b53e3972f6d932ae8efd51660362a7de95de858a122689da2d7b05da6f09e43839779a4701d96335445461b044602c6
|
data/lib/spaceborne/version.rb
CHANGED
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,
|
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
|
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.
|
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-
|
11
|
+
date: 2021-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|