api_sim 4.1.0 → 4.2.0

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
  SHA1:
3
- metadata.gz: 7ff0a391691c542a6fc8287eae0509ae75a50dec
4
- data.tar.gz: 98cb0bcd10294f4265472e9abeba25944dcb3504
3
+ metadata.gz: 41575a14132a1b2470aa099534aa545b2adbd0b6
4
+ data.tar.gz: 527e676491d88348720564aac06f4933202c3307
5
5
  SHA512:
6
- metadata.gz: fc0501e35b92c6d0fa3a6707e05a9f2b7ae1707f09ba36b5696924e596bbc878d0c38f08a5b998f8f26badd571e4cbee5f03442fba1fb3eb142a7ca17e15dc6c
7
- data.tar.gz: 8caf39e0478c844028d9e185c5b1d0439ba784402288ae7532cd5e33b617b12ea4c50061a4c8d5ff66625b6ce2337208f84d250b23afb94e306b1dd0d0616fc9
6
+ metadata.gz: 9d5998dd5a4aaaba866eb5150e501ee8cacda17068fda2220510ac0f166d6e312bd3290dae821449cc8e39fa6a2c1e7f09e12383e2bb557febeafbcf3382a215
7
+ data.tar.gz: '092d59402a7599b6da24d2ef9e8f913357d7f76918aa434f395396f456d35d313e24d6b497f818783357157e640068afc6a16b0c5c96f353d9777bf2f765e00e'
@@ -7,7 +7,7 @@ module ApiSim
7
7
 
8
8
  def rackapp
9
9
  config = self
10
- Class.new(BuiltApp) do
10
+ Sinatra.new(BuiltApp) do
11
11
  endpoints config.endpoint_configurations
12
12
  end
13
13
  end
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module ApiSim
2
- VERSION = "4.1.0"
2
+ VERSION = "4.2.0"
3
3
  end
@@ -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.1.0
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: 2016-12-15 00:00:00.000000000 Z
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.5.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