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.
@@ -12,7 +12,19 @@ module Net
12
12
  end
13
13
 
14
14
  # Send request
15
- response = request_without_wiretap(request, body, &block)
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
@@ -6,7 +6,7 @@ require 'fileutils'
6
6
 
7
7
  module HTTP
8
8
  class Wiretap
9
- VERSION = '0.1.0'
9
+ VERSION = '0.1.1'
10
10
 
11
11
  ############################################################################
12
12
  # Static Initializers
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
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-23 00:00:00 -07:00
18
+ date: 2011-02-24 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency