api_sim 4.1.0 → 4.2.0
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41575a14132a1b2470aa099534aa545b2adbd0b6
|
4
|
+
data.tar.gz: 527e676491d88348720564aac06f4933202c3307
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d5998dd5a4aaaba866eb5150e501ee8cacda17068fda2220510ac0f166d6e312bd3290dae821449cc8e39fa6a2c1e7f09e12383e2bb557febeafbcf3382a215
|
7
|
+
data.tar.gz: '092d59402a7599b6da24d2ef9e8f913357d7f76918aa434f395396f456d35d313e24d6b497f818783357157e640068afc6a16b0c5c96f353d9777bf2f765e00e'
|
data/lib/api_sim/app_builder.rb
CHANGED
@@ -38,7 +38,8 @@ module ApiSim
|
|
38
38
|
|
39
39
|
def record_request(request)
|
40
40
|
request.body.rewind
|
41
|
-
requests.push(RecordedRequest.new(body: request.body.read, request_env: request.env, request_path: request.path
|
41
|
+
requests.push(RecordedRequest.new(body: request.body.read, request_env: request.env, request_path: request.path,
|
42
|
+
query_string: request.params))
|
42
43
|
end
|
43
44
|
|
44
45
|
def to_s
|
@@ -1,12 +1,13 @@
|
|
1
1
|
module ApiSim
|
2
2
|
class RecordedRequest
|
3
|
-
attr_reader :time, :headers, :body, :path
|
3
|
+
attr_reader :time, :headers, :body, :path, :query
|
4
4
|
|
5
|
-
def initialize(time: Time.now, body:, request_env:, request_path:)
|
5
|
+
def initialize(time: Time.now, body:, request_env:, request_path:, query_string: )
|
6
6
|
@time = time
|
7
7
|
@body = body
|
8
8
|
@headers = parse_headers_from(request_env)
|
9
9
|
@path = request_path
|
10
|
+
@query = query_string
|
10
11
|
end
|
11
12
|
|
12
13
|
def to_json(options = {})
|
@@ -15,6 +16,7 @@ module ApiSim
|
|
15
16
|
headers: @headers,
|
16
17
|
path: @path,
|
17
18
|
time: @time,
|
19
|
+
query: @query
|
18
20
|
}.to_json
|
19
21
|
end
|
20
22
|
|
data/lib/api_sim/version.rb
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
<th>Time</th>
|
9
9
|
<th>Body</th>
|
10
10
|
<th>Route</th>
|
11
|
+
<th>Query Params</th>
|
11
12
|
<th>Headers</th>
|
12
13
|
</tr>
|
13
14
|
</thead>
|
@@ -17,6 +18,15 @@
|
|
17
18
|
<th class="header-column"><p><%= request.time %></p></th>
|
18
19
|
<td><p><%= h request.body %></p></td>
|
19
20
|
<td><p><%= h request.path %></p></td>
|
21
|
+
<td>
|
22
|
+
<ul>
|
23
|
+
<% request.query.each do |name, value| %>
|
24
|
+
<li><%= name %>:
|
25
|
+
<%= value %>
|
26
|
+
</li>
|
27
|
+
<% end %>
|
28
|
+
</ul>
|
29
|
+
</td>
|
20
30
|
<td>
|
21
31
|
<ul>
|
22
32
|
<% request.headers.each do |header, value| %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_sim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TJ Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
189
|
version: '0'
|
190
190
|
requirements: []
|
191
191
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.
|
192
|
+
rubygems_version: 2.6.8
|
193
193
|
signing_key:
|
194
194
|
specification_version: 4
|
195
195
|
summary: A DSL on top of sinatra for building application simulators
|