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 +4 -4
- data/CHANGELOG.txt +1 -0
- data/http_sim.gemspec +1 -1
- data/lib/http_sim.rb +6 -0
- data/lib/response.html.erb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a72f2bf7f0e80cce27d8287e9f5a3539ccaf36af
|
4
|
+
data.tar.gz: 41ddee6f956a5adc8229019d4b766d6a7a79749b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
+
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
|
data/lib/response.html.erb
CHANGED
@@ -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>
|