fakeit 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/fakeit/app/app.rb +10 -1
- data/lib/fakeit/version.rb +1 -1
- 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: fa4cb42c0187e460b3cbf72489ba5d0b7c8b3556a89a9ab770c4c263c271e633
|
4
|
+
data.tar.gz: f2285fe3eb42ac9e0b5f02130cab64794d2be425dd1f09a21b1334ba34f94125
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08c47760084910719518328975bcd2768428fc76a7cfe9da3a4a2075aebac66865b8a13e67344a19b3899a3598a0bf9a34aca8437ba860bba6a3f0dcc61ca868'
|
7
|
+
data.tar.gz: 8a29d3e962e7ecbd8f3cab02b480d01be9f279ae2f4d87194c3b58009dea2426e8acd5dd718e19a93215bfbff63a57569c11deecf0c2d0ffba614bb6e9470b85
|
data/Gemfile.lock
CHANGED
data/lib/fakeit/app/app.rb
CHANGED
@@ -37,7 +37,7 @@ module Fakeit
|
|
37
37
|
def validate(operation, request)
|
38
38
|
operation.validate(
|
39
39
|
body: request.body&.read.to_s,
|
40
|
-
params: request.
|
40
|
+
params: parse_query(request.query_string),
|
41
41
|
headers: headers(request)
|
42
42
|
)
|
43
43
|
end
|
@@ -49,6 +49,15 @@ module Fakeit
|
|
49
49
|
.map { |k, v| [k.sub(/^HTTP_/, '').split('_').map(&:capitalize).join('-'), v] }
|
50
50
|
.to_h
|
51
51
|
end
|
52
|
+
|
53
|
+
def parse_query(query_string)
|
54
|
+
rack_query = Rack::Utils.parse_nested_query(query_string)
|
55
|
+
cgi_query = CGI.parse(query_string)
|
56
|
+
|
57
|
+
rack_query.merge(cgi_query.slice(*rack_query.keys)) do |_, oldval, newval|
|
58
|
+
newval.is_a?(Array) && newval.size > 1 ? newval : oldval
|
59
|
+
end
|
60
|
+
end
|
52
61
|
end
|
53
62
|
end
|
54
63
|
end
|
data/lib/fakeit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fakeit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Feng
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|