http_sim 0.0.7 → 1.0.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: 4099a803c584f2bfcc99221146df54fd94d08006
4
- data.tar.gz: faa01c38b740a304663ce17c4e83dac7329ee8ab
3
+ metadata.gz: a72f2bf7f0e80cce27d8287e9f5a3539ccaf36af
4
+ data.tar.gz: 41ddee6f956a5adc8229019d4b766d6a7a79749b
5
5
  SHA512:
6
- metadata.gz: 2ad9529b8139e6de649cd35c2e534d2664601e3afced7caccf1cfb9316c34566b5b4fcb6915c33d9d42c0f7a2ca076e8b0ddacc84fd23d462b353fd4dce28676
7
- data.tar.gz: 6f7d08bf223ad0e8c17c840bc2e3fad767fb61ddfdfe1fcaec4d265ec0f9b056fa8b691a87aa1bfd206d38620daa900da0d2b4dc0dfab22ae28aa2d590f1464e
6
+ metadata.gz: 5a889e786d1fc0197366861598a710831f82d993ca304c1d5289af96425215083522c7acf88194324ba3afa83c3acf8cb0de8a37a1d6c9001b35041243e3f861
7
+ data.tar.gz: f4ec7db79b14c0636e1decf242fac83d9a6e9f7e13bfaa521a3414200d2d9e016469fee3581e52ea209707b97147b97feff0c0cfe3f21558663963c3800591e9
data/CHANGELOG.txt CHANGED
@@ -5,3 +5,4 @@ Version 0.0.4 Added run_daemon!, stop_daemon!, and wait_for_start methods
5
5
  Version 0.0.5 run_daemon! now writes to a (configurable) log file
6
6
  Version 0.0.6 PUT and DELETE endpoints now generated for /<endpoint>/response
7
7
  Version 0.0.7 GET, PUT, DELETE /response endpoints now working
8
+ Version 1.0.0 Responses can be changed at /<endpoint>/response. All initial features are now complete
data/http_sim.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'http_sim'
7
- spec.version = '0.0.7'
7
+ spec.version = '1.0.0'
8
8
  spec.authors = ['Jean de Klerk']
9
9
  spec.email = ['jadekler@gmail.com']
10
10
  spec.summary = 'Simulate your external HTTP integrations.'
data/lib/http_sim.rb CHANGED
@@ -170,6 +170,12 @@ module HttpSimulator
170
170
  endpoint.response = request.body.read
171
171
  end
172
172
 
173
+ Sinatra::Base.post "#{endpoint.path}/response" do
174
+ new_response = request.body.read.sub 'response=', ''
175
+ endpoint.response = new_response
176
+ redirect "#{endpoint.path}/response"
177
+ end
178
+
173
179
  Sinatra::Base.delete "#{endpoint.path}/response" do
174
180
  endpoint.response = endpoint.default_response
175
181
  end
@@ -12,5 +12,12 @@
12
12
  <h2>Response for: <%= endpoint.method %> <%= endpoint.path %></h2>
13
13
 
14
14
  <div><%= endpoint.response %></div>
15
+
16
+ <h2>Change response</h2>
17
+
18
+ <form action="<%= endpoint.path %>/response" method="post">
19
+ <textarea name="response"></textarea>
20
+ <input type="submit">
21
+ </form>
15
22
  </body>
16
23
  </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_sim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean de Klerk