request_interceptor 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/request_interceptor.rb +4 -3
- data/lib/request_interceptor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c71d28cdbf09e7e8cef303d41b8bcfe1f52f55a7
|
4
|
+
data.tar.gz: 2fa0efa5e19d3975ad6e502f309141e0dc87abaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75d941129c251e6c0595d53020b1f6ebce625424e5f9a0605881d07ff3059ba05692bec55011440fb973cdb3378c4253b445f9f05519f967dd75f958d52d4f78
|
7
|
+
data.tar.gz: 9e254ab6980c329f7d2780f13f7ee6cb341a103f5602a568b1e07a39122b8c8f43bfb81df2687425a9f63cb64b2a0e0440bd5282d340e92c52bd4a8295f86f27
|
data/lib/request_interceptor.rb
CHANGED
@@ -4,7 +4,7 @@ require "net/http"
|
|
4
4
|
require "rack/mock"
|
5
5
|
|
6
6
|
class RequestInterceptor
|
7
|
-
class Transaction < Struct.new(:request, :
|
7
|
+
class Transaction < Struct.new(:request, :response); end
|
8
8
|
|
9
9
|
GET = "GET".freeze
|
10
10
|
POST = "POST".freeze
|
@@ -93,12 +93,13 @@ class RequestInterceptor
|
|
93
93
|
|
94
94
|
# yield the response because Net::HTTP#request does
|
95
95
|
block.call(response) unless block.nil?
|
96
|
+
|
97
|
+
# log intercepted transaction
|
98
|
+
log_transaction(request, response)
|
96
99
|
else
|
97
100
|
response = real_request(http_context, request, body, &block)
|
98
101
|
end
|
99
102
|
|
100
|
-
log_transaction(request, response)
|
101
|
-
|
102
103
|
response
|
103
104
|
end
|
104
105
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: request_interceptor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Tennhard
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-12-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|