http-wiretap 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/http/ext/net_http.rb +13 -1
- data/lib/http/wiretap.rb +1 -1
- metadata +4 -4
data/lib/http/ext/net_http.rb
CHANGED
@@ -12,7 +12,19 @@ module Net
|
|
12
12
|
end
|
13
13
|
|
14
14
|
# Send request
|
15
|
-
|
15
|
+
block_response = nil
|
16
|
+
block_wrapper = lambda do |res|
|
17
|
+
puts "inside: #{res}"
|
18
|
+
block_response = res
|
19
|
+
block.call(res) unless block.nil?
|
20
|
+
res
|
21
|
+
end
|
22
|
+
return_response = request_without_wiretap(request, body, &block_wrapper)
|
23
|
+
|
24
|
+
# Use whichever
|
25
|
+
response = nil
|
26
|
+
response = return_response if return_response.is_a?(Net::HTTPResponse)
|
27
|
+
response = block_response if response.nil?
|
16
28
|
|
17
29
|
# Log response
|
18
30
|
if ::HTTP::Wiretap.enabled
|
data/lib/http/wiretap.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http-wiretap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ben Johnson
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-24 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|