spaceborne 0.1.25 → 0.1.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/lib/spaceborne.rb +22 -13
- data/lib/spaceborne/version.rb +1 -1
- data/spaceborne.gemspec +1 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c343c5f42e85c4baf10f9f22b530e7e9e1474226d7b5d0d7491eacd31046a72
|
4
|
+
data.tar.gz: dafa9fb460a2b631d9245eaa4b0dbfdd5476c0cf4f58ead485d668a27482fe13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3fa2aa4790c0e737205c089676186f3ebec3dde0bffde2c7d473677020e6e85f20995a2f047afc28d42985b02aa1ac990ab527becc7e9f88c8699c6d43f3d1a
|
7
|
+
data.tar.gz: 2de0cdcb90b4784582c51b4ad1e26e1accc59f01f0ea8f90ea197686d9a76a5b0bb1bf12648bf34e112a6f311359166089320c49143f538473a53895ecc6efe1
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.5.5
|
data/lib/spaceborne.rb
CHANGED
@@ -118,13 +118,18 @@ module Airborne
|
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
121
|
-
def
|
121
|
+
def pre_request(options)
|
122
122
|
@json_body = nil
|
123
123
|
local_options = split_options(options)
|
124
124
|
handle_proxy(options, local_options)
|
125
125
|
hdrs = calc_headers(options, local_options)
|
126
126
|
@request_body = calc_body(options, local_options)
|
127
|
-
|
127
|
+
[hdrs, @request_body]
|
128
|
+
end
|
129
|
+
|
130
|
+
def make_request(method, url, options = {})
|
131
|
+
hdrs, body = pre_request(options)
|
132
|
+
send_restclient(method, get_url(url), body, hdrs)
|
128
133
|
rescue RestClient::ServerBrokeConnection => e
|
129
134
|
raise e
|
130
135
|
rescue RestClient::Exception => e
|
@@ -155,16 +160,16 @@ module Airborne
|
|
155
160
|
end
|
156
161
|
end
|
157
162
|
|
158
|
-
def exception_path_adder(
|
163
|
+
def exception_path_adder(args)
|
159
164
|
yield
|
160
165
|
rescue Airborne::ExpectationError => e
|
161
|
-
e.message << "
|
166
|
+
e.message << "expect arguments: #{args}"
|
162
167
|
raise e
|
163
168
|
end
|
164
169
|
|
165
170
|
def expect_json_types(*args)
|
166
171
|
call_with_relative_path(json_body, args) do |param, body|
|
167
|
-
exception_path_adder(args
|
172
|
+
exception_path_adder(args) do
|
168
173
|
expect_json_types_impl(param, body)
|
169
174
|
end
|
170
175
|
end
|
@@ -172,7 +177,7 @@ module Airborne
|
|
172
177
|
|
173
178
|
def expect_json(*args)
|
174
179
|
call_with_relative_path(json_body, args) do |param, body|
|
175
|
-
exception_path_adder(args
|
180
|
+
exception_path_adder(args) do
|
176
181
|
expect_json_impl(param, body)
|
177
182
|
end
|
178
183
|
end
|
@@ -180,7 +185,7 @@ module Airborne
|
|
180
185
|
|
181
186
|
def expect_header_types(*args)
|
182
187
|
call_with_relative_path(response.headers, args) do |param, body|
|
183
|
-
exception_path_adder(args
|
188
|
+
exception_path_adder(args) do
|
184
189
|
expect_json_types_impl(param, body)
|
185
190
|
end
|
186
191
|
end
|
@@ -188,7 +193,7 @@ module Airborne
|
|
188
193
|
|
189
194
|
def expect_header(*args)
|
190
195
|
call_with_relative_path(response.headers, args) do |param, body|
|
191
|
-
exception_path_adder(args
|
196
|
+
exception_path_adder(args) do
|
192
197
|
expect_json_impl(param, body)
|
193
198
|
end
|
194
199
|
end
|
@@ -225,18 +230,22 @@ module Airborne
|
|
225
230
|
end
|
226
231
|
end
|
227
232
|
|
228
|
-
def
|
233
|
+
def iterate_path(path)
|
229
234
|
raise PathError, "Invalid Path, contains '..'" if /\.\./ =~ path
|
230
235
|
|
231
|
-
type = false
|
232
236
|
parts = path.to_s.split('.')
|
233
237
|
parts.each_with_index do |part, index|
|
238
|
+
yield(parts, part, index)
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
def get_by_path(path, json, type = false, &block)
|
243
|
+
iterate_path(path) do |parts, part, index|
|
234
244
|
if %w[* ?].include?(part)
|
235
245
|
ensure_array_or_hash(path, json)
|
236
246
|
type = part
|
237
|
-
if index < parts.length.pred
|
238
|
-
|
239
|
-
end
|
247
|
+
walk_with_path(type, index, path, parts, json, &block) && return if index < parts.length.pred
|
248
|
+
|
240
249
|
next
|
241
250
|
end
|
242
251
|
json = do_process_json(part, json)
|
data/lib/spaceborne/version.rb
CHANGED
data/spaceborne.gemspec
CHANGED
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.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keith Williams
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -185,15 +185,15 @@ homepage: https://github.com/keithrw54/spaceborne.git
|
|
185
185
|
licenses:
|
186
186
|
- MIT
|
187
187
|
metadata: {}
|
188
|
-
post_install_message:
|
188
|
+
post_install_message:
|
189
189
|
rdoc_options: []
|
190
190
|
require_paths:
|
191
191
|
- lib
|
192
192
|
required_ruby_version: !ruby/object:Gem::Requirement
|
193
193
|
requirements:
|
194
|
-
- -
|
194
|
+
- - '='
|
195
195
|
- !ruby/object:Gem::Version
|
196
|
-
version: '
|
196
|
+
version: '2.5'
|
197
197
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
199
|
- - ">="
|
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
201
|
version: '0'
|
202
202
|
requirements: []
|
203
203
|
rubygems_version: 3.0.8
|
204
|
-
signing_key:
|
204
|
+
signing_key:
|
205
205
|
specification_version: 4
|
206
206
|
summary: Gem supporting API testing
|
207
207
|
test_files: []
|